public abstract class VarInstance_c extends TypeObject_c implements VarInstance
VarInstance
contains type information for a variable. It may
be either a local or a field.Modifier and Type | Field and Description |
---|---|
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 |
position, ts
Modifier | Constructor and Description |
---|---|
protected |
VarInstance_c()
Used for deserializing types.
|
|
VarInstance_c(TypeSystem ts,
Position pos,
Flags flags,
Type type,
java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
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)
Destructively set the constant value of the field.
|
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)
Set the name of the variable.
|
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.
|
copy, equals, position, typeSystem
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
position, typeSystem
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
protected VarInstance_c()
public VarInstance_c(TypeSystem ts, Position pos, Flags flags, Type type, java.lang.String name)
public Declaration declaration()
Declaration
declaration
in interface Declaration
public void setDeclaration(Declaration decl)
Declaration
setDeclaration
in interface Declaration
public boolean constantValueSet()
VarInstance
constantValueSet
in interface VarInstance
public boolean isConstant()
VarInstance
isConstant
in interface VarInstance
public java.lang.Object constantValue()
VarInstance
constantValue
in interface VarInstance
public Flags flags()
VarInstance
flags
in interface VarInstance
public Type type()
VarInstance
type
in interface VarInstance
public java.lang.String name()
VarInstance
name
in interface VarInstance
public int hashCode()
hashCode
in class TypeObject_c
public boolean equalsImpl(TypeObject o)
TypeObject_c
equalsImpl
in interface TypeObject
equalsImpl
in class TypeObject_c
TypeObject_c.equalsImpl(TypeObject)
,
Object.hashCode()
public boolean isCanonical()
TypeObject
isCanonical
in interface TypeObject
public void setType(Type type)
VarInstance
setType
in interface VarInstance
public void setFlags(Flags flags)
VarInstance
setFlags
in interface VarInstance
public void setConstantValue(java.lang.Object constantValue)
VarInstance
setConstantValue
in interface VarInstance
constantValue
- 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 VarInstance
public void setName(java.lang.String name)
VarInstance
setName
in interface VarInstance
name
- The name to set.