|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ptolemy.data.type.StructuredType ptolemy.data.type.MatrixType
public class MatrixType
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}.
Red |
Red (yuhong) |
Nested Class Summary | |
---|---|
static class |
MatrixType.BooleanMatrixType
The boolean matrix data type. |
static class |
MatrixType.ComplexMatrixType
The complex matrix data type. |
static class |
MatrixType.DoubleMatrixType
The double matrix data type. |
static class |
MatrixType.FixMatrixType
The fix matrix data type. |
static class |
MatrixType.IntMatrixType
The integer matrix data type. |
static class |
MatrixType.LongMatrixType
The long matrix data type. |
Field Summary | |
---|---|
private Type |
_elementType
The type of the elements of the matrix, or ScalarType for this base class. |
private java.lang.String |
_name
The name of this instance. |
private java.lang.Class |
_tokenClass
The type of MatrixToken that this class represents. |
Fields inherited from class ptolemy.data.type.StructuredType |
---|
MAXDEPTHBOUND |
Fields inherited from interface ptolemy.data.type.Type |
---|
HASH_INVALID, HASH_MAX |
Constructor Summary | |
---|---|
MatrixType(java.lang.Class c,
Type type,
java.lang.String name)
Construct a new matrix type that represents matrix tokens of the given class with the given number of rows and columns. |
Method Summary | |
---|---|
protected int |
_compare(StructuredType type)
Compare this type with the specified type. |
protected StructuredType |
_getRepresentative()
Return a static instance of this structured type. |
protected StructuredType |
_greatestLowerBound(StructuredType type)
Return the greatest lower bound of this type with the specified type. |
protected StructuredType |
_leastUpperBound(StructuredType type)
Return the least upper bound of this type with the specified type. |
java.lang.Object |
clone()
Return this, that is, return the reference to this object. |
Token |
convert(Token token)
If the argument is an instance of this class or a subclass, then return the token. |
boolean |
equals(java.lang.Object object)
Determine if the argument represents the same MatrixType as this object. |
Type |
getElementType()
Return the type of the elements contained in an instance of this matrix type. |
static MatrixType |
getMatrixTypeForElementType(Type elementType)
Return a matrix type whose element type is the given element type. |
java.lang.Class |
getTokenClass()
Return the class for tokens that this type represents. |
int |
hashCode()
Return a hash code value for this object. |
void |
initialize(Type type)
Set the elements that have declared type BaseType.UNKNOWN to the specified type. |
boolean |
isAbstract()
Return true if the element type is abstract. |
boolean |
isCompatible(Type type)
Test if the argument type is compatible with this type. |
boolean |
isConstant()
Test if this Type is a constant. |
boolean |
isInstantiable()
Return true, indicating that instances of this type can exist. |
boolean |
isSubstitutionInstance(Type type)
Test if the argument is a substitution instance of this type. |
java.lang.String |
toString()
Return the string representation of this type. |
void |
updateType(StructuredType newType)
Update this StructuredType to the specified Structured Type. |
Methods inherited from class ptolemy.data.type.StructuredType |
---|
add, depth, divide, getTypeHash, modulo, multiply, one, subtract, zero |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.lang.Class _tokenClass
private Type _elementType
private java.lang.String _name
Constructor Detail |
---|
public MatrixType(java.lang.Class c, Type type, java.lang.String name)
c
- The token class.type
- The element type.name
- The name.Method Detail |
---|
public java.lang.Object clone()
clone
in interface Type
clone
in class StructuredType
public Token convert(Token token) throws IllegalActionException
convert
in interface Type
token
- A token.
IllegalActionException
- If the argument is not
an instance of this class.public boolean equals(java.lang.Object object)
equals
in interface Type
equals
in class java.lang.Object
object
- A Type.
public Type getElementType()
public static MatrixType getMatrixTypeForElementType(Type elementType) throws IllegalActionException
elementType
- The type of the element.
IllegalActionException
- If the elementType is not a
type that has a corresponding matrix type.public java.lang.Class getTokenClass()
getTokenClass
in interface Type
public int hashCode()
hashCode
in class java.lang.Object
public void initialize(Type type)
initialize
in class StructuredType
type
- A Type.public boolean isAbstract()
isAbstract
in interface Type
isAbstract
in class StructuredType
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 java.lang.String toString()
toString
in interface Type
toString
in class java.lang.Object
public void updateType(StructuredType newType) throws IllegalActionException
updateType
in class StructuredType
newType
- A StructuredType.
IllegalActionException
- If the specified type has a
different structure.protected int _compare(StructuredType type)
_compare
in class StructuredType
type
- a StructuredType.
java.lang.IllegalArgumentException
- If the specified type is
not the same structured type as this one.protected StructuredType _getRepresentative()
_getRepresentative
in class StructuredType
protected StructuredType _greatestLowerBound(StructuredType type)
_greatestLowerBound
in class StructuredType
type
- a StructuredType.
java.lang.IllegalArgumentException
- If the specified type is
not the same structured type as this one.protected StructuredType _leastUpperBound(StructuredType type)
_leastUpperBound
in class StructuredType
type
- a StructuredType.
java.lang.IllegalArgumentException
- If the specified type is
not the same structured type as this one.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |