polyglot.ext.jl.types
Class TypeObject_c

java.lang.Object
  extended by polyglot.ext.jl.types.TypeObject_c
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, TypeObject, Copy
Direct Known Subclasses:
InitializerInstance_c, Key_c, KeySet_c, Package_c, PClass_c, ProcedureInstance_c, ThrowConstraint_c, Type_c, UnknownQualifier_c, VarInstance_c

public abstract class TypeObject_c
extends java.lang.Object
implements TypeObject

Abstract implementation of a type object. Contains a reference to the type system and to the object's position in the code.

See Also:
Serialized Form

Field Summary
protected  Position position
           
protected  TypeSystem ts
           
 
Constructor Summary
protected TypeObject_c()
          Used for deserializing types.
  TypeObject_c(TypeSystem ts)
          Creates a new type in the given a TypeSystem.
  TypeObject_c(TypeSystem ts, Position pos)
           
 
Method Summary
 java.lang.Object copy()
           
 boolean equals(java.lang.Object o)
          Return whether o equals this.
 boolean equalsImpl(TypeObject t)
          Default implementation is pointer equality.
 int hashCode()
           
 Position position()
          The object's position, or null.
 TypeSystem typeSystem()
          The object's type system.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface polyglot.types.TypeObject
isCanonical
 

Field Detail

ts

protected transient TypeSystem ts

position

protected Position position
Constructor Detail

TypeObject_c

protected TypeObject_c()
Used for deserializing types.


TypeObject_c

public TypeObject_c(TypeSystem ts)
Creates a new type in the given a TypeSystem.


TypeObject_c

public TypeObject_c(TypeSystem ts,
                    Position pos)
Method Detail

copy

public java.lang.Object copy()
Specified by:
copy in interface Copy

typeSystem

public TypeSystem typeSystem()
Description copied from interface: TypeObject
The object's type system.

Specified by:
typeSystem in interface TypeObject

position

public Position position()
Description copied from interface: TypeObject
The object's position, or null.

Specified by:
position in interface TypeObject

equals

public final boolean equals(java.lang.Object o)
Return whether o equals this. Implementations should override equalsImpl().

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equalsImpl

public boolean equalsImpl(TypeObject t)
Default implementation is pointer equality.

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