Package ptolemy.data

Class 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 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".