polyglot.types
Interface VarInstance

All Superinterfaces:
java.lang.Cloneable, Copy, Declaration, java.io.Serializable, TypeObject
All Known Subinterfaces:
FieldInstance, LocalInstance
All Known Implementing Classes:
FieldInstance_c, LocalInstance_c, VarInstance_c

public interface VarInstance
extends TypeObject, Declaration

A VarInstance contains type information for a variable. It may be either a local or a field.


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.
 Flags flags()
          The flags of the variable.
 boolean isConstant()
          Whether the variable has a constant value.
 java.lang.String name()
          The name of the variable.
 void setConstantValue(java.lang.Object value)
          Destructively set the constant value of the field.
 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 interface polyglot.types.Declaration
declaration, setDeclaration
 

Method Detail

flags

Flags flags()
The flags of the variable.


name

java.lang.String name()
The name of the variable.


setName

void setName(java.lang.String name)

type

Type type()
The type of the variable.


constantValueSet

boolean constantValueSet()
Whether the variable's constant value has been set yet.


constantValue

java.lang.Object constantValue()
The variable's constant value, or null.


setConstantValue

void setConstantValue(java.lang.Object value)
Destructively set the constant value of the field.

Parameters:
value - the constant value. Should be an instance of String, Boolean, Byte, Short, Character, Integer, Long, Float, Double, or null.

setNotConstant

void setNotConstant()
Mark the variable as not a compile time constant.


isConstant

boolean isConstant()
Whether the variable has a constant value.


setType

void setType(Type type)
Destructively set the type of the variable. This method should be deprecated.


setFlags

void setFlags(Flags flags)
Destructively set the flags of the variable.