public class TupleToken extends Token
Modifier and Type | Field and Description |
---|---|
static TupleToken |
VOID
An empty tuple token.
|
Constructor and Description |
---|
TupleToken(Token[] value)
Construct a TupleToken with the specified token array as its value.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object object)
Return true if the class of the argument is TupleToken and it
has the same length and the elements are equal to that of this
token.
|
Token |
getElement(int index)
Return the element at the specified index.
|
Type |
getElementType(int index)
Return the element type at the specified index.
|
Type |
getType()
Return the type of this token, which is a TupleType populated
with the types of the value of this token.
|
int |
hashCode()
Return a hash code value for this token.
|
BooleanToken |
isEqualTo(Token token)
Return a true-valued token if the argument is equal to this one.
|
int |
length()
Return the length of the contained token array.
|
static TupleToken |
merge(TupleToken first,
TupleToken second)
Merge two tuple tokens into one by concatenating their tokens.
|
Token |
one()
Return a new TupleToken representing the multiplicative
identity.
|
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[] |
tupleValue()
Return an array of tokens populated with the contents of this
array token.
|
Token |
zero()
Returns a new TupleToken representing the additive identity.
|
add, addReverse, divide, divideReverse, isCloseTo, isCloseTo, isNil, modulo, moduloReverse, multiply, multiplyReverse, notSupportedConversionMessage, notSupportedIncomparableConversionMessage, notSupportedIncomparableMessage, notSupportedMessage, notSupportedNullNilStringMessage, pow, subtract, subtractReverse, zeroReturnType
public static final TupleToken VOID
public TupleToken(Token[] value)
value
- The value.public Token[] tupleValue()
public boolean equals(java.lang.Object object)
equals
in class java.lang.Object
object
- The object to compare with.public Token getElement(int index)
index
- The index of the desired element.java.lang.ArrayIndexOutOfBoundsException
- If the specified index is
outside the range of the token array.public Type getElementType(int index)
index
- The index of the desired element.java.lang.ArrayIndexOutOfBoundsException
- If the specified index is
outside the range of the token array.public Type getType()
public int hashCode()
hashCode
in class java.lang.Object
public BooleanToken isEqualTo(Token token) throws IllegalActionException
isEqualTo
in class Token
token
- The token to compare to this token.IllegalActionException
- If the element types do not
support this comparison.public int length()
public static TupleToken merge(TupleToken first, TupleToken second)
first
- The first tuple token.second
- The second tuple token.public Token one() throws IllegalActionException
one
in class Token
IllegalActionException
- If multiplicative identity is not
supported by an element token.public java.lang.String toString()
public Token zero() throws IllegalActionException
zero
in class Token
IllegalActionException
- If the additive identity is not
supported by an element token.