Class Tag

  • All Implemented Interfaces:
    java.lang.Comparable

    public class Tag
    extends java.lang.Object
    implements java.lang.Comparable
    A timestamp and a microstamp that represent a Tag.
    Since:
    Ptolemy II 10.0
    Version:
    $Id$
    Author:
    Jia Zou
    Pt.AcceptedRating:
    Red (jiazou)
    Pt.ProposedRating:
    Yellow (jiazou)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int microstep
      The microstep.
      Time timestamp
      The timestamp.
    • Constructor Summary

      Constructors 
      Constructor Description
      Tag()
      Construct an empty Tag.
      Tag​(Time timestamp, int microstep)
      Construct a Tag.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(java.lang.Object other)
      Compare a tag with another.
      boolean equals​(java.lang.Object arg0)
      Checks if this tag is the same as another.
      int hashCode()
      Hashcode for this class.
      java.lang.String toString()
      Return a string representation of this class.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • timestamp

        public Time timestamp
        The timestamp.
      • microstep

        public int microstep
        The microstep.
    • Constructor Detail

      • Tag

        public Tag​(Time timestamp,
                   int microstep)
        Construct a Tag.
        Parameters:
        timestamp - The timestamp.
        microstep - The microstep.
      • Tag

        public Tag()
        Construct an empty Tag.
    • Method Detail

      • compareTo

        public int compareTo​(java.lang.Object other)
        Compare a tag with another.
        Specified by:
        compareTo in interface java.lang.Comparable
        Parameters:
        other - The object to be compared.
        Returns:
        The result of the comparison, which is a lexicographical order with the timestamp as the first element and microstep as the second.
      • equals

        public boolean equals​(java.lang.Object arg0)
        Checks if this tag is the same as another.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        arg0 - The object checking against.
        Returns:
        true if the tags are equal.
      • hashCode

        public int hashCode()
        Hashcode for this class.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        hashcode for this class.
      • toString

        public java.lang.String toString()
        Return a string representation of this class.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a string representation of this class.