Package ptolemy.domains.gr.kernel
Class Scene2DToken.Scene2DType
- java.lang.Object
-
- ptolemy.domains.gr.kernel.Scene2DToken.Scene2DType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,Type
- Enclosing class:
- Scene2DToken
public static class Scene2DToken.Scene2DType extends java.lang.Object implements Type, java.io.Serializable, java.lang.Cloneable
The two dimensional scene type corresponding with a SceneToken.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface ptolemy.data.type.Type
HASH_INVALID
-
-
Constructor Summary
Constructors Constructor Description Scene2DType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Type
add(Type rightArgumentType)
Return a new type which represents the type that results from adding a token of this type and a token of the given argument type.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.Type
divide(Type rightArgumentType)
Return a new type which represents the type that results from dividing a token of this type and a token of the given argument type.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 figure index in the (constant) type lattice.boolean
isAbstract()
Return true if this type does not correspond to a single token class.boolean
isCompatible(Type type)
Test if the argument type is compatible with this type.boolean
isConstant()
Test 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.Type
modulo(Type rightArgumentType)
Return a new type which represents the type that results from moduloing a token of this type and a token of the given argument type.Type
multiply(Type rightArgumentType)
Return a new type which represents the type that results from multiplying a token of this type and a token of the given argument type.Type
one()
Return the type of the multiplicative identity for elements of this type.Type
subtract(Type rightArgumentType)
Return a new type which represents the type that results from subtracting a token of this type and a token of the given argument type.java.lang.String
toString()
Return the string representation of this type.Type
zero()
Return the type of the additive identity for elements of this type.
-
-
-
Method Detail
-
add
public Type add(Type rightArgumentType)
Return a new type which represents the type that results from adding a token of this type and a token of the given argument type.
-
clone
public java.lang.Object clone()
Return this, that is, return the reference to this object.
-
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 interfaceType
- Parameters:
token
- A token.- Returns:
- A token.
- Throws:
IllegalActionException
- If lossless conversion cannot be done.
-
divide
public Type divide(Type rightArgumentType)
Return a new type which represents the type that results from dividing a token of this type and a token of the given argument type.
-
getTokenClass
public java.lang.Class getTokenClass()
Return the class for tokens that this basetype represents.- Specified by:
getTokenClass
in interfaceType
- Returns:
- the class for tokens that this basetype represents.
-
isAbstract
public boolean isAbstract()
Return true if this type does not correspond to a single token class. This occurs if the type is not instantiable, or it represents either an abstract base class or an interface.- Specified by:
isAbstract
in interfaceType
- Returns:
- Always return false, this token is instantiable.
-
isCompatible
public boolean isCompatible(Type type)
Test 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 interfaceType
- Parameters:
type
- An instance of Type.- Returns:
- True if the argument type is compatible with this type.
-
isConstant
public boolean isConstant()
Test if this Type is UNKNOWN.- Specified by:
isConstant
in interfaceType
- 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 figure index in the (constant) type lattice.- Specified by:
getTypeHash
in interfaceType
- Returns:
- this type's figure 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 interfaceType
- 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 interfaceType
- Parameters:
type
- A Type.- Returns:
- True if this type is UNKNOWN; false otherwise.
-
modulo
public Type modulo(Type rightArgumentType)
Return a new type which represents the type that results from moduloing a token of this type and a token of the given argument type.
-
multiply
public Type multiply(Type rightArgumentType)
Return a new type which represents the type that results from multiplying a token of this type and a token of the given argument type.
-
one
public Type one()
Return the type of the multiplicative identity for elements of this type.
-
subtract
public Type subtract(Type rightArgumentType)
Return a new type which represents the type that results from subtracting a token of this type and a token of the given argument type.
-
toString
public java.lang.String toString()
Return the string representation of this type.
-
-