ptolemy.data
Class ActorToken.ActorType

java.lang.Object
  extended byptolemy.data.ActorToken.ActorType
All Implemented Interfaces:
java.io.Serializable, Type
Enclosing class:
ActorToken

public static class ActorToken.ActorType
extends java.lang.Object
implements Type, java.io.Serializable

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface ptolemy.data.type.Type
HASH_INVALID, HASH_MAX
 
Constructor Summary
ActorToken.ActorType()
           
 
Method Summary
 java.lang.Object clone()
          Return this, that is, return the reference to this object.
 Token convert(Token token)
          Convert the specified token to a token having the type represented by this object.
 boolean equals(Type t)
          Determine if the argument represents the same BaseType as this object.
 java.lang.Class getTokenClass()
          Return the class for tokens that this basetype represents.
 int getTypeHash()
          Return this type's node index in the (constant) type lattice.
 boolean isCompatible(Type type)
          Model if the argument type is compatible with this type.
 boolean isConstant()
          Model if this Type is UNKNOWN.
 boolean isInstantiable()
          Determine if this type corresponds to an instantiable token classes.
 boolean isSubstitutionInstance(Type type)
          Return true if the argument is a substitution instance of this type.
 java.lang.String toString()
          Return the string representation of this type.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ptolemy.data.type.Type
equals
 

Constructor Detail

ActorToken.ActorType

public ActorToken.ActorType()
Method Detail

clone

public java.lang.Object clone()
Return this, that is, return the reference to this object.

Specified by:
clone in interface Type
Returns:
A BaseType.

convert

public Token convert(Token token)
              throws IllegalActionException
Convert the specified token to a token having the type represented by this object.

Specified by:
convert in interface Type
Parameters:
token - A token.
Returns:
A token.
Throws:
IllegalActionException - If lossless conversion cannot be done.

getTokenClass

public java.lang.Class getTokenClass()
Return the class for tokens that this basetype represents.

Specified by:
getTokenClass in interface Type

isCompatible

public boolean isCompatible(Type type)
Model if the argument type is compatible with this type. The method returns true if this type is UNKNOWN, since any type is a substitution instance of it. If this type is not UNKNOWN, this method returns true if the argument type is less than or equal to this type in the type lattice, and false otherwise.

Specified by:
isCompatible in interface Type
Parameters:
type - An instance of Type.
Returns:
True if the argument type is compatible with this type.

isConstant

public boolean isConstant()
Model if this Type is UNKNOWN.

Specified by:
isConstant in interface Type
Returns:
True if this Type is not UNKNOWN; false otherwise.

equals

public boolean equals(Type t)
Determine if the argument represents the same BaseType as this object.

Parameters:
t - A Type.
Returns:
True if the argument represents the same BaseType as this object; false otherwise.

getTypeHash

public int getTypeHash()
Return this type's node index in the (constant) type lattice.

Specified by:
getTypeHash in interface Type
Returns:
this type's node index in the (constant) type lattice.

isInstantiable

public boolean isInstantiable()
Determine if this type corresponds to an instantiable token classes. A BaseType is instantiable if it does not correspond to an abstract token class, or an interface, or UNKNOWN.

Specified by:
isInstantiable in interface Type
Returns:
True if this type is instantiable.

isSubstitutionInstance

public boolean isSubstitutionInstance(Type type)
Return true if the argument is a substitution instance of this type.

Specified by:
isSubstitutionInstance in interface Type
Parameters:
type - A Type.
Returns:
True if this type is UNKNOWN; false otherwise.

toString

public java.lang.String toString()
Return the string representation of this type.

Specified by:
toString in interface Type
Returns:
A String.