public class LongToken extends ScalarToken
Red (cxh) |
Yellow (cxh) nil token, ONE, ZERO |
Modifier and Type | Field and Description |
---|---|
static LongToken |
NIL
A token that represents a missing value.
|
static LongToken |
ONE
A LongToken with the value 1.0.
|
static LongToken |
ZERO
A LongToken with the value 0.0.
|
_unitCategoryExponents
Constructor and Description |
---|
LongToken()
Construct a token with long integer 0.
|
LongToken(long value)
Construct a token with the specified value.
|
LongToken(java.lang.String init)
Construct a token from the given String.
|
Modifier and Type | Method and Description |
---|---|
protected ScalarToken |
_absolute()
Return a ScalarToken containing the absolute value of the
value of this token.
|
protected ScalarToken |
_add(ScalarToken rightArgument)
Return a new token whose value is the value of the
argument Token added to the value of this Token.
|
protected ScalarToken |
_bitwiseAnd(ScalarToken rightArgument)
Returns a token representing the bitwise AND of this token and
the given token.
|
protected ScalarToken |
_bitwiseNot()
Returns a token representing the bitwise NOT of this token.
|
protected ScalarToken |
_bitwiseOr(ScalarToken rightArgument)
Returns a token representing the bitwise OR of this token and
the given token.
|
protected ScalarToken |
_bitwiseXor(ScalarToken rightArgument)
Returns a token representing the bitwise XOR of this token and
the given token.
|
protected ScalarToken |
_divide(ScalarToken rightArgument)
Return a new token whose value is the value of this token
divided by the value of the argument token.
|
protected BooleanToken |
_isCloseTo(ScalarToken rightArgument,
double epsilon)
Test whether the value of this token is close to the first
argument, where "close" means that the distance between their
values is less than or equal to the second argument.
|
protected BooleanToken |
_isLessThan(ScalarToken rightArgument)
Test for ordering of the values of this Token and the argument
Token.
|
protected ScalarToken |
_modulo(ScalarToken rightArgument)
Return a new token whose value is the value of this token
modulo the value of the argument token.
|
protected ScalarToken |
_multiply(ScalarToken rightArgument)
Return a new token whose value is the value of this token
multiplied by the value of the argument token.
|
protected ScalarToken |
_subtract(ScalarToken rightArgument)
Return a new token whose value is the value of the argument token
subtracted from the value of this token.
|
static LongToken |
convert(Token token)
Convert the specified token into an instance of LongToken.
|
boolean |
equals(java.lang.Object object)
Return true if the argument's class is LongToken and it has the
same values as this token.
|
Type |
getType()
Return the type of this token.
|
int |
hashCode()
Return a hash code value for this token.
|
boolean |
isNil()
Return true if the token is nil, (aka null or missing).
|
ScalarToken |
leftShift(int bits)
Returns a token representing the result of shifting the bits
of this token towards the most significant bit, filling the
least significant bits with zeros.
|
ScalarToken |
logicalRightShift(int bits)
Returns a token representing the result of shifting the bits
of this token towards the least significant bit, filling the
most significant bits with zeros.
|
long |
longValue()
Return the value in the token as a long.
|
Token |
one()
Returns a LongToken with value 1.
|
ScalarToken |
rightShift(int bits)
Returns a token representing the result of shifting the bits
of this token towards the least significant bit, filling the
most significant bits with the sign of the value.
|
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.
|
UnsignedByteToken |
truncatedUnsignedByteValue()
Return the value in the token truncated to an unsignedByte.
|
Token |
zero()
Returns a LongToken with value 0.
|
_addCategoryExponents, _areUnitsEqual, _copyOfCategoryExponents, _isEqualTo, _isUnitless, _subtractCategoryExponents, absolute, add, addReverse, bitwiseAnd, bitwiseNot, bitwiseOr, bitwiseXor, byteValue, complexValue, divide, divideReverse, doubleValue, fixValue, floatValue, intValue, inUnitsOf, isCloseTo, isEqualTo, isGreaterThan, isLessThan, isLessThan, modulo, moduloReverse, multiply, multiplyReverse, setUnitCategory, shortValue, subtract, subtractReverse, unitsString
isCloseTo, notSupportedConversionMessage, notSupportedIncomparableConversionMessage, notSupportedIncomparableMessage, notSupportedMessage, notSupportedNullNilStringMessage, pow, zeroReturnType
public static final LongToken NIL
public static final LongToken ONE
public static final LongToken ZERO
public LongToken()
public LongToken(long value)
value
- The specified value.public LongToken(java.lang.String init) throws IllegalActionException
init
- The specified string, for example 1L
2L
. Note that 3
will also result
a LongToken with a value of 3 being created.IllegalActionException
- If the Token could not
be created with the given String.public static LongToken convert(Token token) throws IllegalActionException
NIL
. Otherwise, if the argument is below LongToken in the
type hierarchy, it is converted to an instance of LongToken or
one of the subclasses of LongToken and returned. If none of
the above condition is met, an exception is thrown.token
- The token to be converted to a LongToken.IllegalActionException
- If the conversion
cannot be carried out.public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- An instance of Object.public Type getType()
getType
in class ScalarToken
public int hashCode()
hashCode
in class java.lang.Object
public boolean isNil()
public ScalarToken leftShift(int bits)
leftShift
in class ScalarToken
bits
- The number of bits to shift.NIL
is returned.public ScalarToken logicalRightShift(int bits)
logicalRightShift
in class ScalarToken
bits
- The number of bits to shift.NIL
is returned.public long longValue()
longValue
in class ScalarToken
public Token one()
public ScalarToken rightShift(int bits)
rightShift
in class ScalarToken
bits
- The number of bits to shift.NIL
is returned.public java.lang.String toString()
public UnsignedByteToken truncatedUnsignedByteValue() throws IllegalActionException
IllegalActionException
- If the value is not in the
range of an unsigned byte.public Token zero()
protected ScalarToken _absolute()
_absolute
in class ScalarToken
protected ScalarToken _add(ScalarToken rightArgument)
_add
in class ScalarToken
rightArgument
- The token to add to this token.protected ScalarToken _bitwiseAnd(ScalarToken rightArgument)
_bitwiseAnd
in class ScalarToken
rightArgument
- The LongToken to bitwise AND with this one.protected ScalarToken _bitwiseNot()
_bitwiseNot
in class ScalarToken
protected ScalarToken _bitwiseOr(ScalarToken rightArgument)
_bitwiseOr
in class ScalarToken
rightArgument
- The LongToken to bitwise OR with this one.protected ScalarToken _bitwiseXor(ScalarToken rightArgument)
_bitwiseXor
in class ScalarToken
rightArgument
- The LongToken to bitwise XOR with this one.protected ScalarToken _divide(ScalarToken rightArgument)
_divide
in class ScalarToken
rightArgument
- The token to divide this token by.protected BooleanToken _isCloseTo(ScalarToken rightArgument, double epsilon)
_isCloseTo
in class ScalarToken
rightArgument
- The token to compare to this token.epsilon
- The distance.protected BooleanToken _isLessThan(ScalarToken rightArgument) throws IllegalActionException
_isLessThan
in class ScalarToken
rightArgument
- The token to add to this token.IllegalActionException
- If this method is not
supported by the derived class.protected ScalarToken _modulo(ScalarToken rightArgument)
_modulo
in class ScalarToken
rightArgument
- The token to modulo this token by.protected ScalarToken _multiply(ScalarToken rightArgument)
_multiply
in class ScalarToken
rightArgument
- The token to multiply this token by.protected ScalarToken _subtract(ScalarToken rightArgument)
_subtract
in class ScalarToken
rightArgument
- The token to subtract from this token.