public class TupleType extends StructuredType implements java.lang.Cloneable
MAXDEPTHBOUNDHASH_INVALID| Constructor and Description |
|---|
TupleType(Type[] types)
Construct a new TupleType with the specified argument types
and the given return type.
|
| Modifier and Type | Method and Description |
|---|---|
protected int |
_compare(StructuredType type)
Compare this type with the specified type.
|
protected StructuredType |
_getRepresentative()
Return a static instance of TupleType.
|
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 a deep copy of this TupleType if it is a variable, or
itself if it is a constant.
|
Token |
convert(Token token)
Convert the argument token into an ArrayToken having this
type, if losslessly conversion can be done.
|
boolean |
equals(java.lang.Object object)
Determine if the argument represents the same TupleType as
this object.
|
ptolemy.data.type.TupleType.FieldTypeTerm |
getArgTypeTerm(int i)
Return the InequalityTerm representing the type of the given
argument.
|
int |
getElementCount()
Return the number of arguments in this type.
|
Type |
getElementType(int i)
Return the type of the given argument.
|
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 (the leaf
type variable) to the specified type.
|
boolean |
isCompatible(Type type)
Test if the argument type is compatible with this type.
|
boolean |
isConstant()
Test if this TupleType is a constant.
|
boolean |
isInstantiable()
Test if this type corresponds to an instantiable token
class.
|
boolean |
isSubstitutionInstance(Type type)
Test if the specified type is a substitution instance of this
type.
|
java.lang.String |
toString()
Return the string representation of this type.
|
void |
updateType(StructuredType newType)
Update this type to the specified TupleType.
|
add, depth, divide, getTypeHash, isAbstract, modulo, multiply, one, subtract, zeropublic TupleType(Type[] types)
types - An array of Type.java.lang.IllegalArgumentException - If the labels and types do
not have the same size.java.lang.NullPointerException - If one of the arguments is null.public java.lang.Object clone()
clone in interface Typeclone in class StructuredTypepublic Token convert(Token token) throws IllegalActionException
convert in interface Typetoken - A token.IllegalActionException - If lossless conversion
cannot be done.public boolean equals(java.lang.Object object)
public int getElementCount()
public Type getElementType(int i)
i - The given argument.public java.lang.Class getTokenClass()
getTokenClass in interface Typepublic ptolemy.data.type.TupleType.FieldTypeTerm getArgTypeTerm(int i)
i - The given argument.InequalityTermpublic int hashCode()
hashCode in class java.lang.Objectpublic void initialize(Type type)
initialize in class StructuredTypetype - the type to set the leaf type variable to.public boolean isCompatible(Type type)
isCompatible in interface Typetype - An instance of Type.public boolean isConstant()
isConstant in interface Typepublic boolean isInstantiable()
isInstantiable in interface Typepublic boolean isSubstitutionInstance(Type type)
isSubstitutionInstance in interface Typetype - A Type.Type.isSubstitutionInstance(ptolemy.data.type.Type)public java.lang.String toString()
public void updateType(StructuredType newType) throws IllegalActionException
updateType in class StructuredTypenewType - A StructuredType.IllegalActionException - If the specified type is not a
TupleType or it does not have the same structure as this one.protected int _compare(StructuredType type)
_compare in class StructuredTypetype - a TupleType.java.lang.IllegalArgumentException - If the specified type is
not a TupleType.protected StructuredType _getRepresentative()
_getRepresentative in class StructuredTypeprotected StructuredType _greatestLowerBound(StructuredType type)
_greatestLowerBound in class StructuredTypetype - a TupleType.java.lang.IllegalArgumentException - If the specified type is
not a TupleType.protected StructuredType _leastUpperBound(StructuredType type)
_leastUpperBound in class StructuredTypetype - a TupleType.java.lang.IllegalArgumentException - If the specified type is
not a TupleType.