|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--ptolemy.data.Token
|
+--ptolemy.data.ScalarToken
|
+--ptolemy.data.FixToken
A token that contains an instance of FixPoint.
Token,
FixPoint,
Precision,
Quantizer, Serialized Form| Fields inherited from class ptolemy.data.ScalarToken |
_unitCategoryExponents |
| Constructor Summary | |
FixToken(double value,
int numberOfBits,
int integerBits)
Construct a FixToken representing the specified value with the specified precision. |
|
FixToken(double value,
Precision precision)
Construct a FixToken representing the specified value with the specified precision. |
|
FixToken(FixPoint value)
Construct a FixToken with the supplied FixPoint value. |
|
FixToken(java.lang.String init)
Construct a FixToken from the specified string. |
|
| Method Summary | |
ScalarToken |
absolute()
Return a new FixToken containing the absolute value of this token. |
Token |
add(Token token)
Return a new token whose value is the sum of this token and the argument. |
Token |
addReverse(Token token)
Return a new token whose value is the sum of this token and the argument. |
double |
convertToDouble()
Return the fixed point value of this token as a double. |
Token |
divide(Token divisor)
Return a new Token whose value is the value of this token divided by the value of the argument token. |
Token |
divideReverse(Token dividend)
Return a new token whose value is the value of the argument token divided by the value of this token. |
boolean |
equals(java.lang.Object object)
Return true if the argument is an instance of FixToken with the same value. |
FixPoint |
fixValue()
Return the value of this token as a FixPoint. |
Type |
getType()
Return the type of this token. |
int |
hashCode()
Return a hash code value for this token. |
BooleanToken |
isEqualTo(Token token)
Test the values of this Token and the argument Token for equality. |
BooleanToken |
isLessThan(ScalarToken arg)
Check whether the value of this token is strictly less than that of the argument token. |
Token |
multiply(Token token)
Return a new token whose value is the product of this token and the argument. |
Token |
multiplyReverse(Token token)
Return a new token whose value is the product of this token and the argument. |
Token |
one()
Returns a new Token representing the multiplicative identity with the same precision as this FixToken. |
void |
print()
Print the content of this FixToken: This is used for debugging only. |
Token |
subtract(Token rightArgument)
Return a new Token whose value is the value of the argument token subtracted from the value of this token. |
Token |
subtractReverse(Token leftArgument)
Return a new token whose value is the value of this token subtracted from the value of the argument token. |
java.lang.String |
toString()
Return the value of this token as a string that can be parsed by the expression language to recover a token with the same value. |
Token |
zero()
Return a new token representing the additive identity with the same precision as this FixToken. |
| Methods inherited from class ptolemy.data.ScalarToken |
_addCategoryExponents, _areUnitsEqual, _copyOfCategoryExponents, _isUnitless, _subtractCategoryExponents, complexValue, doubleValue, intValue, inUnitsOf, longValue, setUnitCategory, unitsString |
| Methods inherited from class ptolemy.data.Token |
_notSupportedMessage, convert, isCloseTo, isCloseTo, modulo, moduloReverse |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public FixToken(FixPoint value)
value - A FixPoint value.
public FixToken(double value,
Precision precision)
throws java.lang.IllegalArgumentException
value - The value to represent.precision - The precision to use.java.lang.IllegalArgumentException - If the supplied precision
is invalid.
public FixToken(double value,
int numberOfBits,
int integerBits)
throws java.lang.IllegalArgumentException
value - The value to represent.numberOfBits - The total number of bits.integerBits - The number of integer bits.java.lang.IllegalArgumentException - If the supplied precision
is invalid.
public FixToken(java.lang.String init)
throws IllegalActionException
init - A string expression of a fixed point number in Ptolemy II
expression language syntax.IllegalActionException - If the string does
not contain a parsable fixed point number.| Method Detail |
public ScalarToken absolute()
absolute in class ScalarToken
public Token add(Token token)
throws IllegalActionException
add in class Tokentoken - The token to add to this one.IllegalActionException - If the specified token
is not of a type that can be added to this token.
public Token addReverse(Token token)
throws IllegalActionException
addReverse in class Tokentoken - The token to add this Token to.IllegalActionException - If the specified token
is not of a type that can be added to this token.public double convertToDouble()
public Token divide(Token divisor)
throws IllegalActionException
divide in class Tokendivisor - A FixToken.IllegalActionException - If the passed token is
not of a type that can be divide this Tokens value by.
public Token divideReverse(Token dividend)
throws IllegalActionException
divideReverse in class Tokendividend - The token to be divided by the value of this Token.IllegalActionException - If the type of the specified
token is not lower than FixToken.public boolean equals(java.lang.Object object)
equals in class Tokenobject - An instance of Object.public FixPoint fixValue()
fixValue in class ScalarTokenpublic Type getType()
getType in class ScalarTokenpublic int hashCode()
hashCode in class Token
public BooleanToken isEqualTo(Token token)
throws IllegalActionException
isEqualTo in class Tokentoken - The token to test equality of this token with.IllegalActionException - If the specified token is
not of a type that can be compared with this Token.
public BooleanToken isLessThan(ScalarToken arg)
throws IllegalActionException
isLessThan in class ScalarTokenarg - A ScalarToken.IllegalActionException - If the type of the argument token
is incomparable with the type of this token.
public Token multiply(Token token)
throws IllegalActionException
multiply in class Tokenarg - A FixToken.IllegalActionException - If the specified token
is not of a type that can be multiplied to this Token.
public Token multiplyReverse(Token token)
throws IllegalActionException
multiplyReverse in class Tokentoken - The token with which to multiply this Token.IllegalActionException - If the type of the specified
token is not lower than FixToken.public Token one()
one in class Token
public Token subtract(Token rightArgument)
throws IllegalActionException
subtract in class Tokentoken - A FixToken.IllegalActionException - If the specified token is
not of a type that can be subtracted from this Token.
public Token subtractReverse(Token leftArgument)
throws IllegalActionException
subtractReverse in class TokenleftArgument - The token to subtract this token from.IllegalActionException - If the type of the specified
token is not lower than FixToken;public java.lang.String toString()
toString in class Tokenpublic Token zero()
zero in class Tokenpublic void print()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||