ptolemy.data
Class EventToken

java.lang.Object
  extended by ptolemy.data.Token
      extended by ptolemy.data.EventToken
All Implemented Interfaces:
java.io.Serializable

public class EventToken
extends Token

A token representing a pure event.

Since:
Ptolemy II 0.2
Version:
$Id: EventToken.java 43472 2006-08-21 23:16:56Z cxh $
Author:
Steve Neuendorffer
See Also:
Serialized Form
Accepted Rating:
Red (neuendor)
Proposed Rating:
Red (neuendor)

Field Summary
 
Fields inherited from class ptolemy.data.Token
NIL
 
Constructor Summary
EventToken()
           
 
Method Summary
 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
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EventToken

public EventToken()
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 class java.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.

Overrides:
getType in class Token
Returns:
BaseType.GENERAL

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 class java.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.

Overrides:
toString in class Token
Returns:
The String "present".