public abstract class StructuredType extends java.lang.Object implements Type
Subclasses should override clone() to do a deep cloning.
Red (cxh) |
Red (yuhong) |
Modifier and Type | Field and Description |
---|---|
protected static int |
MAXDEPTHBOUND
Set up a bound for the max depth of structured types.
|
HASH_INVALID
Constructor and Description |
---|
StructuredType() |
Modifier and Type | Method and Description |
---|---|
protected abstract int |
_compare(StructuredType type)
Compare this type with the specified type.
|
protected abstract StructuredType |
_getRepresentative()
Return a static instance of this structured type.
|
protected abstract StructuredType |
_greatestLowerBound(StructuredType type)
Return the greatest lower bound of this type with the specified
type.
|
protected abstract StructuredType |
_leastUpperBound(StructuredType type)
Return the least upper bound of this type with the specified
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.
|
abstract java.lang.Object |
clone()
Return a deep copy of this StructuredType.
|
int |
depth()
Return the depth of a structured type.
|
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.
|
int |
getTypeHash()
Return a perfect hash for this type.
|
abstract void |
initialize(Type type)
Set the elements that have declared type BaseType.UNKNOWN to the
specified type.
|
boolean |
isAbstract()
Return true if this type does not correspond to a single token
class.
|
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.
|
void |
updateType(StructuredType newType)
Update this StructuredType to the specified Structured Type.
|
Type |
zero()
Return the type of the additive identity for elements of
this type.
|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
convert, equals, getTokenClass, isCompatible, isConstant, isInstantiable, isSubstitutionInstance, toString
protected static final int MAXDEPTHBOUND
public Type add(Type rightArgumentType)
public abstract java.lang.Object clone() throws java.lang.CloneNotSupportedException
public Type divide(Type rightArgumentType)
public int depth()
public int getTypeHash()
getTypeHash
in interface Type
public boolean isAbstract()
isAbstract
in interface Type
public abstract void initialize(Type type)
type
- A Type.public Type modulo(Type rightArgumentType)
public Type multiply(Type rightArgumentType)
public Type one()
public Type subtract(Type rightArgumentType)
public void updateType(StructuredType newType) throws IllegalActionException
newType
- A StructuredType.IllegalActionException
- If the specified type has a
different structure.public Type zero()
protected abstract int _compare(StructuredType type)
type
- a StructuredType.java.lang.IllegalArgumentException
- If the specified type is
not the same structured type as this one.protected abstract StructuredType _getRepresentative()
protected abstract StructuredType _greatestLowerBound(StructuredType type)
type
- a StructuredType.java.lang.IllegalArgumentException
- If the specified type is
not the same structured type as this one.protected abstract StructuredType _leastUpperBound(StructuredType type)
type
- a StructuredType.java.lang.IllegalArgumentException
- If the specified type is
not the same structured type as this one.