|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ptolemy.data.type.BaseType
public abstract class BaseType
The type of base token classes. This class provides a type safe enumeration of base types.
Red |
Red (yuhong) |
Nested Class Summary | |
---|---|
static class |
BaseType.ArrayBottomType
The bottom element of the array type lattice. |
static class |
BaseType.BooleanType
The boolean data type. |
static class |
BaseType.ComplexType
The complex data type. |
static class |
BaseType.DoubleType
The double data type. |
static class |
BaseType.EventType
The event data type. |
static class |
BaseType.FloatType
The float data type. |
static class |
BaseType.GeneralType
The general data type: The top of the lattice. |
static class |
BaseType.IntType
The integer data type. |
static class |
BaseType.LongType
The long integer data type. |
static class |
BaseType.NilType
The nil data type. |
static class |
BaseType.PetiteType
The petite data type. |
static class |
BaseType.ScalarType
The scalar data type: The least upper bound of all the scalar types. |
static class |
BaseType.ShortType
The short integer data type. |
static class |
BaseType.StringType
The string data type. |
static class |
BaseType.UnknownType
The bottom element of the data type lattice. |
static class |
BaseType.UnsignedByteType
The unsigned byte data type. |
static class |
BaseType.UnsizedFixType
The fix data type. |
static class |
BaseType.XmlTokenType
The XmlToken data type. |
Field Summary | |
---|---|
private static java.util.Map |
_classNameToType
A map from class name to the type for all base types. |
private java.lang.String |
_name
The name of the type. |
private static java.util.Map |
_nameToType
A map from type name to the type for all base types. |
private java.lang.Class |
_tokenClass
The class of tokens with this type. |
static Type |
ACTOR
The actor data type. |
static BaseType.ArrayBottomType |
ARRAY_BOTTOM
The bottom element of the array type lattice. |
static BaseType.BooleanType |
BOOLEAN
The boolean data type. |
static MatrixType.BooleanMatrixType |
BOOLEAN_MATRIX
The boolean matrix data type. |
static BaseType.ComplexType |
COMPLEX
The complex data type. |
static MatrixType.ComplexMatrixType |
COMPLEX_MATRIX
The complex matrix data type. |
static BaseType.DoubleType |
DOUBLE
The double data type. |
static MatrixType.DoubleMatrixType |
DOUBLE_MATRIX
The double matrix data type. |
static BaseType.EventType |
EVENT
The event data type. |
static BaseType.UnsizedFixType |
FIX
An alias for the unsized fix data type, provided for backward compatibility with the previous versions of Ptolemy. |
static MatrixType.FixMatrixType |
FIX_MATRIX
The fix matrix data type. |
static BaseType.FloatType |
FLOAT
The float data type. |
static BaseType.GeneralType |
GENERAL
The general data type: The top of the lattice. |
static BaseType.IntType |
INT
The integer data type. |
static MatrixType.IntMatrixType |
INT_MATRIX
The integer matrix data type. |
static BaseType.LongType |
LONG
The long integer data type. |
static MatrixType.LongMatrixType |
LONG_MATRIX
The long integer matrix data type. |
static MatrixType |
MATRIX
The matrix data type: The least upper bound of all the matrix types. |
static BaseType.NilType |
NIL
The nil data type. |
static ObjectType |
OBJECT
The object data type. |
static BaseType.PetiteType |
PETITE
The petite data type. |
static RecordType |
RECORD
Setting the type of something to RECORD allows it to take on a value that is any record with any fields. |
static BaseType.ScalarType |
SCALAR
The scalar data type: The least upper bound of all the scalar types. |
static BaseType.ShortType |
SHORT
The short integer data type. |
static FixType |
SIZED_FIX
The fix data type, with a precision specified. |
static BaseType.StringType |
STRING
The string data type. |
static BaseType.UnknownType |
UNKNOWN
The bottom element of the data type lattice. |
static BaseType.UnsignedByteType |
UNSIGNED_BYTE
The unsigned byte data type. |
static BaseType.UnsizedFixType |
UNSIZED_FIX
The unsized fix data type. |
static BaseType.XmlTokenType |
XMLTOKEN
The XmlToken data type. |
Fields inherited from interface ptolemy.data.type.Type |
---|
HASH_INVALID, HASH_MAX |
Constructor Summary | |
---|---|
private |
BaseType(java.lang.Class c,
java.lang.String name)
The constructor is private to make a type safe enumeration. |
Method Summary | |
---|---|
(package private) static void |
_addType(Type type,
java.lang.String name,
java.lang.Class theClass)
Add entries in this class to index the given name and class to the given type. |
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. |
abstract Token |
convert(Token t)
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(java.lang.Object object)
Determine if the argument represents the same BaseType as this object. |
static Type |
forClassName(java.lang.String className)
Return an instance of Type of that corresponds to tokens of a class with the given name, or null if none exists. |
static Type |
forName(java.lang.String name)
Return an instance of this class with the specified name, or null if none exists. |
java.lang.Class |
getTokenClass()
Return the class for tokens that this basetype represents. |
int |
getTypeHash()
Return a perfect hash for this type. |
int |
hashCode()
Return a hash code value for this object. |
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. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final BaseType.UnknownType UNKNOWN
public static final BaseType.ArrayBottomType ARRAY_BOTTOM
public static final BaseType.BooleanType BOOLEAN
public static final MatrixType.BooleanMatrixType BOOLEAN_MATRIX
public static final BaseType.UnsignedByteType UNSIGNED_BYTE
public static final BaseType.ComplexType COMPLEX
public static final MatrixType.ComplexMatrixType COMPLEX_MATRIX
public static final BaseType.FloatType FLOAT
public static final BaseType.DoubleType DOUBLE
public static final MatrixType.DoubleMatrixType DOUBLE_MATRIX
public static final BaseType.UnsizedFixType FIX
public static final BaseType.UnsizedFixType UNSIZED_FIX
public static final FixType SIZED_FIX
public static final MatrixType.FixMatrixType FIX_MATRIX
public static final BaseType.ShortType SHORT
public static final BaseType.IntType INT
public static final MatrixType.IntMatrixType INT_MATRIX
public static final BaseType.LongType LONG
public static final MatrixType.LongMatrixType LONG_MATRIX
public static final ObjectType OBJECT
public static final Type ACTOR
public static final BaseType.XmlTokenType XMLTOKEN
public static final BaseType.ScalarType SCALAR
public static final MatrixType MATRIX
public static final BaseType.StringType STRING
public static final BaseType.GeneralType GENERAL
public static final BaseType.EventType EVENT
public static final BaseType.PetiteType PETITE
public static final BaseType.NilType NIL
public static final RecordType RECORD
something.setTypeEquals(BaseType.RECORD);To allow the type to resolve to a specific record type (with particular fields), do instead
something.setTypeAtMost(BaseType.RECORD);This will work for example to require a parameter to have a record value, but to allow its type to resolve to the specific record specified.
private java.lang.Class _tokenClass
private java.lang.String _name
private static java.util.Map _nameToType
private static java.util.Map _classNameToType
Constructor Detail |
---|
private BaseType(java.lang.Class c, java.lang.String name)
Method Detail |
---|
public Type add(Type rightArgumentType)
add
in interface Type
rightArgumentType
- The type to add to this type.
public java.lang.Object clone()
clone
in interface Type
clone
in class java.lang.Object
public abstract Token convert(Token t) throws IllegalActionException
convert
in interface Type
t
- A token.
IllegalActionException
- If lossless conversion cannot
be done.public Type divide(Type rightArgumentType)
divide
in interface Type
rightArgumentType
- The type to add to this type.
public boolean equals(java.lang.Object object)
equals
in interface Type
equals
in class java.lang.Object
object
- Another object.
public static Type forClassName(java.lang.String className)
className
- The name of the class.
public static Type forName(java.lang.String name)
name
- The name of the type.
public java.lang.Class getTokenClass()
getTokenClass
in interface Type
public int getTypeHash()
getTypeHash
in interface Type
public int hashCode()
hashCode
in class java.lang.Object
public Type modulo(Type rightArgumentType)
modulo
in interface Type
rightArgumentType
- The type to add to this type.
public Type multiply(Type rightArgumentType)
multiply
in interface Type
rightArgumentType
- The type to add to this type.
public boolean isAbstract()
isAbstract
in interface Type
public boolean isCompatible(Type type)
isCompatible
in interface Type
type
- An instance of Type.
public boolean isConstant()
isConstant
in interface Type
public boolean isInstantiable()
isInstantiable
in interface Type
public boolean isSubstitutionInstance(Type type)
isSubstitutionInstance
in interface Type
type
- A Type.
public Type one()
one
in interface Type
public Type subtract(Type rightArgumentType)
subtract
in interface Type
rightArgumentType
- The type to add to this type.
public java.lang.String toString()
toString
in interface Type
toString
in class java.lang.Object
public Type zero()
zero
in interface Type
static void _addType(Type type, java.lang.String name, java.lang.Class theClass)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |