|
|||||||||
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.FunctionType
public class FunctionType
A class representing the type of a FunctionToken.
Red (cxh) |
Red (neuendor) |
Nested Class Summary | |
---|---|
private class |
FunctionType.FieldTypeTerm
|
Field Summary | |
---|---|
private FunctionType.FieldTypeTerm[] |
_argTypeTerms
|
private static FunctionType |
_representative
|
private FunctionType.FieldTypeTerm |
_returnTypeTerm
|
Fields inherited from class ptolemy.data.type.StructuredType |
---|
MAXDEPTHBOUND |
Fields inherited from interface ptolemy.data.type.Type |
---|
HASH_INVALID, HASH_MAX |
Constructor Summary | |
---|---|
FunctionType(Type[] types,
Type returnType)
Construct a new FunctionType with the specified argument types and the given return type. |
Method Summary | |
---|---|
protected int |
_compare(StructuredType type)
Compare this type with the specified type. |
protected StructuredType |
_getRepresentative()
Return a static instance of FunctionType. |
protected StructuredType |
_greatestLowerBound(StructuredType type)
Return the greatest lower bound of this type with the specified type. |
private boolean |
_isLessThanOrEqualTo(FunctionType t1,
FunctionType t2)
|
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 FunctionType if it is a variable, or itself if it is a constant. |
Token |
convert(Token token)
Convert the argument token into a FunctionToken having this type, if lossless conversion can be done. |
boolean |
equals(java.lang.Object object)
Determine if the argument represents the same FunctionType as this object. |
int |
getArgCount()
Return the number of arguments in this type. |
Type |
getArgType(int i)
Return the type of the given argument. |
FunctionType.FieldTypeTerm |
getArgTypeTerm(int i)
Return the InequalityTerm representing the type of the given argument. |
Type |
getReturnType()
Return the type of the specified label. |
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 |
isAbstract()
Test if this type corresponds to an abstract token class. |
boolean |
isCompatible(Type type)
Test if the argument type is compatible with this type. |
boolean |
isConstant()
Test if this FunctionType 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 FunctionType. |
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 FunctionType.FieldTypeTerm[] _argTypeTerms
private FunctionType.FieldTypeTerm _returnTypeTerm
private static FunctionType _representative
Constructor Detail |
---|
public FunctionType(Type[] types, Type returnType)
types
- An array of Type.returnType
- An 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.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 lossless conversion
cannot be done.public boolean equals(java.lang.Object object)
equals
in interface Type
equals
in class java.lang.Object
object
- Another object.
public int getArgCount()
public Type getArgType(int i)
i
- The index of the type.
public Type getReturnType()
public java.lang.Class getTokenClass()
getTokenClass
in interface Type
public FunctionType.FieldTypeTerm getArgTypeTerm(int i)
i
- The index of the type.
InequalityTerm
public int hashCode()
hashCode
in class java.lang.Object
public void initialize(Type type)
initialize
in class StructuredType
type
- the type to set the leaf type variable to.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.
Type.isSubstitutionInstance(ptolemy.data.type.Type)
public java.lang.String toString()
function(a0:<type>, a1:<type>, ...)
<type>
Note that the function argument names are
not semantically significant.
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 is not a
FunctionType or it does not have the same structure as this one.protected int _compare(StructuredType type)
_compare
in class StructuredType
type
- a FunctionType.
java.lang.IllegalArgumentException
- If the specified type is
not a FunctionType.protected StructuredType _getRepresentative()
_getRepresentative
in class StructuredType
protected StructuredType _greatestLowerBound(StructuredType type)
_greatestLowerBound
in class StructuredType
type
- a FunctionType.
java.lang.IllegalArgumentException
- If the specified type is
not a FunctionType.protected StructuredType _leastUpperBound(StructuredType type)
_leastUpperBound
in class StructuredType
type
- a FunctionType.
java.lang.IllegalArgumentException
- If the specified type is
not a FunctionType.private boolean _isLessThanOrEqualTo(FunctionType t1, FunctionType t2)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |