polyglot.ext.jl.types
Class FieldInstance_c

java.lang.Object
  extended bypolyglot.ext.jl.types.TypeObject_c
      extended bypolyglot.ext.jl.types.VarInstance_c
          extended bypolyglot.ext.jl.types.FieldInstance_c
All Implemented Interfaces:
java.lang.Cloneable, Copy, FieldInstance, MemberInstance, java.io.Serializable, TypeObject, VarInstance

public class FieldInstance_c
extends VarInstance_c
implements FieldInstance

A FieldInstance contains type information for a field.

See Also:
Serialized Form

Field Summary
protected  ReferenceType container
           
 
Fields inherited from class polyglot.ext.jl.types.VarInstance_c
constantValue, flags, isConstant, name, type
 
Fields inherited from class polyglot.ext.jl.types.TypeObject_c
position, ts
 
Constructor Summary
protected FieldInstance_c()
          Used for deserializing types.
  FieldInstance_c(TypeSystem ts, Position pos, ReferenceType container, Flags flags, Type type, java.lang.String name)
           
 
Method Summary
 FieldInstance constantValue(java.lang.Object constantValue)
          Non-destructive update of constant value.
 ReferenceType container()
          Return the member's containing type.
 FieldInstance container(ReferenceType container)
          Set the containing class of the field.
 boolean equalsImpl(TypeObject o)
          Return true iff this type object is the same as t.
 FieldInstance flags(Flags flags)
          Set the flags of the field.
 boolean isCanonical()
          Return true if the type object contains no unknown/ambiguous types.
 FieldInstance name(java.lang.String name)
          Set the name of the field.
 void setConstantValue(java.lang.Object constantValue)
          Destructive update of constant value.
 void setType(Type type)
          Destructively set the type of the variable.
 java.lang.String toString()
           
 FieldInstance type(Type type)
          Set the type of the field.
 
Methods inherited from class polyglot.ext.jl.types.VarInstance_c
constantValue, flags, hashCode, isConstant, name, type
 
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, wait, wait, wait
 
Methods inherited from interface polyglot.types.VarInstance
constantValue, flags, isConstant, name, type
 
Methods inherited from interface polyglot.types.TypeObject
position, typeSystem
 
Methods inherited from interface polyglot.util.Copy
copy
 
Methods inherited from interface polyglot.types.MemberInstance
flags
 

Field Detail

container

protected ReferenceType container
Constructor Detail

FieldInstance_c

protected FieldInstance_c()
Used for deserializing types.


FieldInstance_c

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

container

public ReferenceType container()
Description copied from interface: MemberInstance
Return the member's containing type.

Specified by:
container in interface MemberInstance

setConstantValue

public void setConstantValue(java.lang.Object constantValue)
Destructive update of constant value.

Specified by:
setConstantValue in interface FieldInstance
Parameters:
constantValue - the constant value. Should be an instance of String, Boolean, Byte, Short, Character, Integer, Long, Float, Double, or null.

constantValue

public FieldInstance constantValue(java.lang.Object constantValue)
Non-destructive update of constant value.

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

container

public FieldInstance container(ReferenceType container)
Description copied from interface: FieldInstance
Set the containing class of the field.

Specified by:
container in interface FieldInstance

flags

public FieldInstance flags(Flags flags)
Description copied from interface: FieldInstance
Set the flags of the field.

Specified by:
flags in interface FieldInstance

name

public FieldInstance name(java.lang.String name)
Description copied from interface: FieldInstance
Set the name of the field.

Specified by:
name in interface FieldInstance

type

public FieldInstance type(Type type)
Description copied from interface: FieldInstance
Set the type of the field.

Specified by:
type in interface FieldInstance

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

equalsImpl

public boolean equalsImpl(TypeObject o)
Description copied from interface: TypeObject
Return true iff this type object is the same as t. All Polyglot extensions should attempt to maintain pointer equality between TypeObjects. If this cannot be done, extensions can override TypeObject_c.equalsImpl(), and don't forget to override hashCode().

Specified by:
equalsImpl in interface TypeObject
Overrides:
equalsImpl in class VarInstance_c

toString

public java.lang.String toString()

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
Overrides:
isCanonical in class VarInstance_c