Package ptolemy.data
Class EventToken
- java.lang.Object
-
- ptolemy.data.Token
-
- ptolemy.data.EventToken
-
public class EventToken extends Token
A token representing a pure event.- Since:
- Ptolemy II 0.2
- Version:
- $Id$
- Author:
- Steve Neuendorffer
- Pt.AcceptedRating:
- Red (neuendor)
- Pt.ProposedRating:
- Red (neuendor)
-
-
Constructor Summary
Constructors Constructor Description EventToken()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object object)
Override the base class method to check whether the value of this token is equal to that of the argument.Type
getType()
Return the type of this token.int
hashCode()
Return a hash code value for this 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, isEqualTo, isNil, modulo, moduloReverse, multiply, multiplyReverse, notSupportedConversionMessage, notSupportedIncomparableConversionMessage, notSupportedIncomparableMessage, notSupportedMessage, notSupportedNullNilStringMessage, one, pow, subtract, subtractReverse, zero, zeroReturnType
-
-
-
-
Method Detail
-
equals
public boolean equals(java.lang.Object object)
Override the base class method to check whether the value of this token is equal to that of the argument. Since this base token class does not have any state, this method returns true if the argument is an instance of Token, but not an instance of a subclass of Token or any other classes.- Overrides:
equals
in classjava.lang.Object
- Parameters:
object
- An instance of Object.- Returns:
- True if the argument is an instance of Token, but not an instance of a subclass of Token or any other classes.
-
getType
public Type getType()
Return the type of this token.
-
hashCode
public int hashCode()
Return a hash code value for this token. Since the equals() method in this base Token class returns true for all instances of Token, all instances of Token must have the same hash code. To achieve this, this method simply returns the value 0.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- The integer 0.
-
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.
-
-