Package ptolemy.data.type
Class ActorType
- java.lang.Object
-
- ptolemy.data.type.ActorType
-
- All Implemented Interfaces:
java.lang.Cloneable,Type
public class ActorType extends java.lang.Object implements Type, java.lang.Cloneable
The base type of matrix token classes. This type functions as a union of the various matrix types. It allows for the creation of arrays that consist of diverse matrix types, because the array type will be {matrix}.- Since:
- Ptolemy II 8.0
- Version:
- $Id$
- Author:
- Steve Neuendorffer and Edward A. Lee
- Pt.AcceptedRating:
- Red
- Pt.ProposedRating:
- Red (yuhong)
-
-
Field Summary
-
Fields inherited from interface ptolemy.data.type.Type
HASH_INVALID
-
-
Constructor Summary
Constructors Constructor Description ActorType()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Typeadd(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.Objectclone()Return this, that is, return the reference to this object.Tokenconvert(Token token)Convert the specified token to a token having the type represented by this object.Typedivide(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.booleanequals(Type t)Determine if the argument represents the same BaseType as this object.java.lang.ClassgetTokenClass()Return the class for tokens that this basetype represents.intgetTypeHash()Return this type's node index in the (constant) type lattice.booleanisAbstract()Return true if this type does not correspond to a single token class.booleanisCompatible(Type type)Model if the argument type is compatible with this type.booleanisConstant()Model if this Type is UNKNOWN.booleanisInstantiable()Determine if this type corresponds to an instantiable token classes.booleanisSubstitutionInstance(Type type)Return true if the argument is a substitution instance of this type.Typemodulo(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.Typemultiply(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.Typeone()Return the type of the multiplicative identity for elements of this type.Typesubtract(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.StringtoString()Return the string representation of this type.Typezero()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:
convertin 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.
-
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.
-
getTokenClass
public java.lang.Class getTokenClass()
Return the class for tokens that this basetype represents.- Specified by:
getTokenClassin interfaceType- Returns:
- the class for tokens that this basetype represents.
-
getTypeHash
public int getTypeHash()
Return this type's node index in the (constant) type lattice.- Specified by:
getTypeHashin interfaceType- Returns:
- this type's node index in the (constant) type lattice.
-
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:
isAbstractin interfaceType- Returns:
- Always return false, this token is instantiable.
-
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:
isCompatiblein interfaceType- 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:
isConstantin interfaceType- Returns:
- True if this Type is not UNKNOWN; false otherwise.
-
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:
isInstantiablein 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:
isSubstitutionInstancein 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.
-
-