|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectpolyglot.types.TypeObject_c
polyglot.types.VarInstance_c
public abstract class VarInstance_c
A VarInstance contains type information for a variable. It may
be either a local or a field.
| Field Summary | |
|---|---|
protected java.lang.Object |
constantValue
|
protected boolean |
constantValueSet
|
protected VarInstance |
decl
|
protected Flags |
flags
|
protected boolean |
isConstant
|
protected java.lang.String |
name
|
protected Type |
type
|
| Fields inherited from class polyglot.types.TypeObject_c |
|---|
position, ts |
| Constructor Summary | |
|---|---|
protected |
VarInstance_c()
Used for deserializing types. |
|
VarInstance_c(TypeSystem ts,
Position pos,
Flags flags,
Type type,
java.lang.String name)
|
| Method Summary | |
|---|---|
java.lang.Object |
constantValue()
The variable's constant value, or null. |
boolean |
constantValueSet()
Whether the variable's constant value has been set yet. |
Declaration |
declaration()
Get the original declaration. |
boolean |
equalsImpl(TypeObject o)
Default implementation is pointer equality. |
Flags |
flags()
The flags of the variable. |
int |
hashCode()
|
boolean |
isCanonical()
Return true if the type object contains no unknown/ambiguous types. |
boolean |
isConstant()
Whether the variable has a constant value. |
java.lang.String |
name()
The name of the variable. |
void |
setConstantValue(java.lang.Object constantValue)
Destructive update of constant value. |
void |
setDeclaration(Declaration decl)
Set the original declaration. |
void |
setFlags(Flags flags)
Destructively set the flags of the variable. |
void |
setName(java.lang.String name)
|
void |
setNotConstant()
Mark the variable as not a compile time constant. |
void |
setType(Type type)
Destructively set the type of the variable. |
Type |
type()
The type of the variable. |
| Methods inherited from class polyglot.types.TypeObject_c |
|---|
copy, equals, position, typeSystem |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Flags flags
protected Type type
protected java.lang.String name
protected java.lang.Object constantValue
protected boolean isConstant
protected boolean constantValueSet
protected VarInstance decl
| Constructor Detail |
|---|
protected VarInstance_c()
public VarInstance_c(TypeSystem ts,
Position pos,
Flags flags,
Type type,
java.lang.String name)
| Method Detail |
|---|
public Declaration declaration()
Declaration
declaration in interface Declarationpublic void setDeclaration(Declaration decl)
Declaration
setDeclaration in interface Declarationpublic boolean constantValueSet()
VarInstance
constantValueSet in interface VarInstancepublic boolean isConstant()
VarInstance
isConstant in interface VarInstancepublic java.lang.Object constantValue()
VarInstance
constantValue in interface VarInstancepublic Flags flags()
VarInstance
flags in interface VarInstancepublic Type type()
VarInstance
type in interface VarInstancepublic java.lang.String name()
VarInstance
name in interface VarInstancepublic int hashCode()
hashCode in class TypeObject_cpublic boolean equalsImpl(TypeObject o)
TypeObject_c
equalsImpl in interface TypeObjectequalsImpl in class TypeObject_cTypeObject_c.equalsImpl(TypeObject),
Object.hashCode()public boolean isCanonical()
TypeObject
isCanonical in interface TypeObjectpublic void setType(Type type)
VarInstance
setType in interface VarInstancepublic void setFlags(Flags flags)
VarInstance
setFlags in interface VarInstancepublic void setConstantValue(java.lang.Object constantValue)
setConstantValue in interface VarInstanceconstantValue - the constant value. Should be an instance of String,
Boolean, Byte, Short, Character, Integer, Long, Float, Double, or null.public void setNotConstant()
VarInstance
setNotConstant in interface VarInstancepublic void setName(java.lang.String name)
setName in interface VarInstancename - The name to set.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||