Package ptolemy.data.type.test
Class TestToken
- java.lang.Object
-
- ptolemy.data.Token
-
- ptolemy.data.type.test.TestToken
-
public class TestToken extends Token
This is a new type of token. It is used to test the TypeLattice to ensure that unspecified token types are allowed, and simply made incomparable to everything else.- Since:
- Ptolemy II 2.0
- Version:
- $Id$
- Author:
- Steve Neuendorffer
- Pt.AcceptedRating:
- Red (neuendor)
- Pt.ProposedRating:
- Red (neuendor)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TestToken.TestType
The class of this token.
-
Constructor Summary
Constructors Constructor Description TestToken(java.lang.Object object)
Construct a token to be used for testing that encapsulates an object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
getObject()
Return the object contained by this token.Type
getType()
Return the type of this token.BooleanToken
isEqualTo(Token token)
Test for equality of the values of this Token and 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.-
Methods inherited from class ptolemy.data.Token
add, addReverse, divide, divideReverse, isCloseTo, isCloseTo, isNil, modulo, moduloReverse, multiply, multiplyReverse, notSupportedConversionMessage, notSupportedIncomparableConversionMessage, notSupportedIncomparableMessage, notSupportedMessage, notSupportedNullNilStringMessage, one, pow, subtract, subtractReverse, zero, zeroReturnType
-
-
-
-
Field Detail
-
TYPE
public static final Type TYPE
The type of this token.
-
-
Method Detail
-
getObject
public java.lang.Object getObject()
Return the object contained by this token.- Returns:
- The object.
-
getType
public Type getType()
Return the type of this token.
-
isEqualTo
public BooleanToken isEqualTo(Token token) throws IllegalActionException
Test for equality of the values of this Token and the argument Token. It should be overridden in derived classes to provide type specific actions for equality testing.- Overrides:
isEqualTo
in classToken
- Parameters:
token
- The token with which to test equality.- Returns:
- A BooleanToken which contains the result of the test.
- Throws:
IllegalActionException
- If this method is not supported by the derived class.
-
toString
public 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. This method should be overridden by derived classes. In this base class, return the String "present" to indicate that an event is present.
-
-