public abstract class BluetoothToken extends Token
This class basically disallows the performing of any arithmatic or algebraic operations on Bluetooth Tokens, as these operations would make no sense on the Bluetooth Token family
BluetoothResponseToken
,
BluetoothStatusToken
Constructor and Description |
---|
BluetoothToken() |
Modifier and Type | Method and Description |
---|---|
Token |
add(Token rightArgument)
Return a new token whose value is the sum of this token and
the argument.
|
Token |
addReverse(Token leftArgument)
Return a new token whose value is the sum of this token
and the argument.
|
Token |
divide(Token rightArgument)
Return a new token whose value is the value of this token
divided by the value of the argument token.
|
Token |
divideReverse(Token leftArgument)
Return a new token whose value is the value of the argument
token divided by the value of this token.
|
BooleanToken |
isCloseTo(Token token,
double epsilon)
Test that the value of this Token is close to the first argument,
where "close" means that the distance between them is less than
or equal to the second argument.
|
Token |
modulo(Token rightArgument)
Return a new token whose value is the value of this token
modulo the value of the argument token.
|
Token |
moduloReverse(Token leftArgument)
Return a new token whose value is the value of the argument token
modulo the value of this token.
|
Token |
multiply(Token rightArgument)
Return a new token whose value is the value of this token
multiplied by the value of the argument token.
|
Token |
multiplyReverse(Token leftArgument)
Return a new token whose value is the value of the argument
token multiplied by the value of this token.
|
Token |
pow(int times)
Return a new token computed as follows:
For positive times arguments, the result represents the product of this token multiplied by itself the number of times given by the argument. |
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.
|
getType, isCloseTo, isEqualTo, isNil, notSupportedConversionMessage, notSupportedIncomparableConversionMessage, notSupportedIncomparableMessage, notSupportedMessage, notSupportedNullNilStringMessage, one, toString, zero, zeroReturnType
public BooleanToken isCloseTo(Token token, double epsilon) throws IllegalActionException
Token
isCloseTo
in class Token
token
- 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.public Token add(Token rightArgument) throws IllegalActionException
Token
add
in class Token
rightArgument
- The token to add to this token.Token.NIL
is returned.IllegalActionException
- If the argument token and
this token are of incomparable types, or the operation does
not make sense for the given types.public Token addReverse(Token leftArgument) throws IllegalActionException
Token
addReverse
in class Token
leftArgument
- The token to add this token to.Token.NIL
is returned.IllegalActionException
- If the argument token and
this token are of incomparable types, or the operation does
not make sense for the given types.public Token divide(Token rightArgument) throws IllegalActionException
Token
divide
in class Token
rightArgument
- The token to divide into this token.Token.NIL
is returned.IllegalActionException
- If the argument token and
this token are of incomparable types, or the operation does
not make sense for the given types.public Token divideReverse(Token leftArgument) throws IllegalActionException
Token
divideReverse
in class Token
leftArgument
- The token to be divided by the value of
this token.IllegalActionException
- If the argument token and
this token are of incomparable types, or the operation does
not make sense for the given types.public Token modulo(Token rightArgument) throws IllegalActionException
Token
modulo
in class Token
rightArgument
- The token to divide into this token.Token.NIL
is returned.IllegalActionException
- If the argument token and
this token are of incomparable types, or the operation does
not make sense for the given types.public Token moduloReverse(Token leftArgument) throws IllegalActionException
Token
moduloReverse
in class Token
leftArgument
- The token to apply modulo to by the value
of this token.
If either this token or the argument token is a nil token, then
Token.NIL
is returned.IllegalActionException
- If the argument token and
this token are of incomparable types, or the operation does
not make sense for the given types.public Token multiply(Token rightArgument) throws IllegalActionException
Token
multiply
in class Token
rightArgument
- The token to multiply this token by.Token.NIL
is returned.IllegalActionException
- If the argument token and
this token are of incomparable types, or the operation does
not make sense for the given types.public Token multiplyReverse(Token leftArgument) throws IllegalActionException
Token
multiplyReverse
in class Token
leftArgument
- The token to be multiplied by the value of
this token.IllegalActionException
- If the argument token and
this token are of incomparable types, or the operation does
not make sense for the given types.public Token pow(int times) throws IllegalActionException
Token
The token type returned by this method is the same as the type of this token. Note that the method is different from java.lang.Math.pow(), since it returns an integer given an integer token type, and is also well defined for matrix types.
pow
in class Token
times
- The number of times to multiply.Token.NIL
is returned.IllegalActionException
- If the token is not
compatible for this operation. Specifically, if the Token
type does not support division (for example matrices) then
using a negative times argument may throw an exception.public Token subtract(Token rightArgument) throws IllegalActionException
Token
subtract
in class Token
rightArgument
- The token to subtract from this token.Token.NIL
is returned.IllegalActionException
- If the argument token and
this token are of incomparable types, or the operation does
not make sense for the given types.public Token subtractReverse(Token leftArgument) throws IllegalActionException
Token
subtractReverse
in class Token
leftArgument
- The token to subtract this token from.Token.NIL
is returned.IllegalActionException
- If the argument token and
this token are of incomparable types, or the operation does
not make sense for the given types.