|
|||||||||
| 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.ComplexToken
A token that contains a Complex.
Token,
Complex, Serialized Form| Fields inherited from class ptolemy.data.ScalarToken |
_unitCategoryExponents |
| Constructor Summary | |
ComplexToken()
Construct a ComplexToken with Complex 0.0+0.0i |
|
ComplexToken(Complex value)
Construct a ComplexToken with the specified value. |
|
ComplexToken(java.lang.String init)
Construct a ComplexToken from the specified string. |
|
| Method Summary | |
ScalarToken |
absolute()
Return a DoubleToken containing the magnitude of the complex 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. |
Complex |
complexValue()
Return the value of this token as a Complex. |
static Token |
convert(Token token)
Convert the specified token into an instance of ComplexToken. |
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 ComplexToken with the same value. |
Type |
getType()
Return the type of this token. |
int |
hashCode()
Return a hash code value for this token. |
BooleanToken |
isCloseTo(Token token)
Test that the magnitude of this Token is close to the magnitude of the argument. |
BooleanToken |
isCloseTo(Token token,
double epsilon)
Test that the magnitude of this Token is close to the magnitude of the argument and that the units of this Token and the argument token are equal. |
BooleanToken |
isEqualTo(Token token)
Test the values of this Token and the argument Token for equality. |
BooleanToken |
isLessThan(ScalarToken arg)
Check if 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 ComplexToken with value 1.0. |
Token |
subtract(Token rightArgument)
Return a new Token whose value is the value of the argument token subtracted by 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()
Returns a new ComplexToken with value Complex.ZERO. |
| Methods inherited from class ptolemy.data.ScalarToken |
_addCategoryExponents, _areUnitsEqual, _copyOfCategoryExponents, _isUnitless, _subtractCategoryExponents, doubleValue, fixValue, intValue, inUnitsOf, longValue, setUnitCategory, unitsString |
| Methods inherited from class ptolemy.data.Token |
_notSupportedMessage, modulo, moduloReverse |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ComplexToken()
public ComplexToken(Complex value)
public ComplexToken(java.lang.String init)
throws IllegalActionException
IllegalActionException - If the string does not represent
a parsable complex 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 Token.IllegalActionException - If the specified token
is not of a type that can be added to this Tokens value.
public Token addReverse(Token token)
throws IllegalActionException
addReverse in class Tokentoken - The token to add this Token to.IllegalActionException - If the type of the specified
token is not lower than ComplexToken.public Complex complexValue()
complexValue in class ScalarToken
public static Token convert(Token token)
throws IllegalActionException
token - The token to be converted to a ComplexToken.IllegalActionException - If the conversion
cannot be carried out.
public Token divide(Token divisor)
throws IllegalActionException
divide in class Tokendivisor - The token to divide this Token byIllegalActionException - If the passed token is
not of a type that can 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 ComplexToken.public boolean equals(java.lang.Object object)
equals in class Tokenobject - An instance of Object.public Type getType()
getType in class ScalarTokenpublic int hashCode()
hashCode in class Token
public BooleanToken isCloseTo(Token token)
throws IllegalActionException
If A and B are the values of the tokens, and if the following is true:
absolute(A-B) < epsilonand the units of A and B are equal, then A and B are considered close.
isCloseTo in class Tokentoken - The token to test closeness of this token with.IllegalActionException - If the argument token is
not of a type that can be compared with this token.Complex.epsilon,
isEqualTo(ptolemy.data.Token),
absolute()
public BooleanToken isCloseTo(Token token,
double epsilon)
throws IllegalActionException
If A and B are the complex values of the tokens, and if the following is true:
absolute(A-B) < epsilonand the units of A and B are equal, then A and B are considered close.
isCloseTo in class Tokentoken - The token to test closeness of this token with.epsilon - The value that we use to determine whether two
tokens are close.IllegalActionException - If the argument token is
not of a type that can be compared with this token.isEqualTo(ptolemy.data.Token),
absolute()
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.isCloseTo(ptolemy.data.Token)
public BooleanToken isLessThan(ScalarToken arg)
throws IllegalActionException
isLessThan in class ScalarTokenarg - A ScalarToken.IllegalActionException - Always thrown.
public Token multiply(Token token)
throws IllegalActionException
multiply in class Tokentoken - The token to multiply to this Token.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 to multiply this Token to.IllegalActionException - If the type of the specified
token is not lower than ComplexToken.public Token one()
one in class Token
public Token subtract(Token rightArgument)
throws IllegalActionException
subtract in class TokenrightArgument - The token to subtract this Token by.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 ComplexToken;public java.lang.String toString()
toString in class Tokenpublic Token zero()
zero in class Token
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||