|
|||||||||
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.FixType
public class FixType
This class represents the type of fix point token objects. Generally the type of a fix point token includes the precision of the token, along with the rounding and quantization techniques that are being applied.
Red |
Red (neuendor) |
Field Summary | |
---|---|
private Precision |
_precision
|
static FixType |
BOTTOM
The bottom fix type. |
Fields inherited from class ptolemy.data.type.StructuredType |
---|
MAXDEPTHBOUND |
Fields inherited from interface ptolemy.data.type.Type |
---|
HASH_INVALID, HASH_MAX |
Constructor Summary | |
---|---|
FixType()
Construct a new fix type, with no integer bits and no fractional bits. |
|
FixType(Precision precision)
Construct a new fix type. |
Method Summary | |
---|---|
protected void |
_checkPrecision()
Check the precision. |
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. |
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. |
Token |
convert(Token token)
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 FixType as this object. |
Precision |
getPrecision()
Return the precision associated with this FixType. |
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 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 a constant. |
boolean |
isInstantiable()
Test if this type corresponds to an instantiable token classes. |
boolean |
isSubstitutionInstance(Type type)
Test 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. |
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. |
Methods inherited from class ptolemy.data.type.StructuredType |
---|
depth, getTypeHash |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final FixType BOTTOM
private Precision _precision
Constructor Detail |
---|
public FixType()
public FixType(Precision precision)
precision
- The precision.Method Detail |
---|
public Type add(Type rightArgumentType)
add
in interface Type
add
in class StructuredType
rightArgumentType
- The type to add to this type.
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 Type divide(Type rightArgumentType)
divide
in interface Type
divide
in class StructuredType
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
- A Type.
public Precision getPrecision()
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 Type modulo(Type rightArgumentType)
modulo
in interface Type
modulo
in class StructuredType
rightArgumentType
- The type to add to this type.
public Type multiply(Type rightArgumentType)
multiply
in interface Type
multiply
in class StructuredType
rightArgumentType
- The type to add to this type.
public Type one()
one
in interface Type
one
in class StructuredType
public Type subtract(Type rightArgumentType)
subtract
in interface Type
subtract
in class StructuredType
rightArgumentType
- The type to add to this 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.public Type zero()
zero
in interface Type
zero
in class StructuredType
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.protected void _checkPrecision()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |