polyglot.ext.jl.types
Class VarInstance_c

java.lang.Object
  extended by polyglot.ext.jl.types.TypeObject_c
      extended by polyglot.ext.jl.types.VarInstance_c
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, TypeObject, VarInstance, Copy
Direct Known Subclasses:
FieldInstance_c, LocalInstance_c

public abstract class VarInstance_c
extends TypeObject_c
implements VarInstance

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

See Also:
Serialized Form

Field Summary
protected  java.lang.Object constantValue
           
protected  Flags flags
           
protected  boolean isConstant
           
protected  java.lang.String name
           
protected  Type type
           
 
Fields inherited from class polyglot.ext.jl.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 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 setFlags(Flags flags)
          Destructively set the flags of the variable.
 void setType(Type type)
          Destructively set the type of the variable.
 Type type()
          The type of the variable.
 
Methods inherited from class polyglot.ext.jl.types.TypeObject_c
copy, equals, position, typeSystem
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface polyglot.types.TypeObject
position, typeSystem
 
Methods inherited from interface polyglot.util.Copy
copy
 

Field Detail

flags

protected Flags flags

type

protected Type type

name

protected java.lang.String name

constantValue

protected java.lang.Object constantValue

isConstant

protected boolean isConstant
Constructor Detail

VarInstance_c

protected VarInstance_c()
Used for deserializing types.


VarInstance_c

public VarInstance_c(TypeSystem ts,
                     Position pos,
                     Flags flags,
                     Type type,
                     java.lang.String name)
Method Detail

isConstant

public boolean isConstant()
Description copied from interface: VarInstance
Whether the variable has a constant value.

Specified by:
isConstant in interface VarInstance

constantValue

public java.lang.Object constantValue()
Description copied from interface: VarInstance
The variable's constant value, or null.

Specified by:
constantValue in interface VarInstance

flags

public Flags flags()
Description copied from interface: VarInstance
The flags of the variable.

Specified by:
flags in interface VarInstance

type

public Type type()
Description copied from interface: VarInstance
The type of the variable.

Specified by:
type in interface VarInstance

name

public java.lang.String name()
Description copied from interface: VarInstance
The name of the variable.

Specified by:
name in interface VarInstance

hashCode

public int hashCode()
Overrides:
hashCode in class TypeObject_c

equalsImpl

public boolean equalsImpl(TypeObject o)
Description copied from class: TypeObject_c
Default implementation is pointer equality.

Specified by:
equalsImpl in interface TypeObject
Overrides:
equalsImpl in class TypeObject_c
See Also:
TypeObject_c.equalsImpl(TypeObject), Object.hashCode()

isCanonical

public boolean isCanonical()
Description copied from interface: TypeObject
Return true if the type object contains no unknown/ambiguous types.

Specified by:
isCanonical in interface TypeObject

setType

public void setType(Type type)
Description copied from interface: VarInstance
Destructively set the type of the variable. This method should be deprecated.

Specified by:
setType in interface VarInstance

setFlags

public void setFlags(Flags flags)
Description copied from interface: VarInstance
Destructively set the flags of the variable.

Specified by:
setFlags in interface VarInstance