Class XEventClass

  • All Implemented Interfaces:
    java.lang.Comparable<XEventClass>

    public class XEventClass
    extends java.lang.Object
    implements java.lang.Comparable<XEventClass>
    Implements an event class. An event class is an identity for events, making them comparable. If two events are part of the same class, they are considered to be equal, i.e. to be referring to the same higher-level concept.
    Author:
    Christian W. Guenther (christian@deckfour.org)
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.lang.String id
      Unique identification string of class.
      protected int index
      Unique index of class.
      protected int size
      Size of class, i.e.
    • Constructor Summary

      Constructors 
      Constructor Description
      XEventClass​(java.lang.String id, int index)
      Creates a new event class instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int compareTo​(XEventClass o)  
      boolean equals​(java.lang.Object o)  
      java.lang.String getId()
      Retrieves the name, i.e.
      int getIndex()
      Returns the index of this event class.
      int hashCode()  
      void incrementSize()
      Increments the size of this class by one, i.e.
      void setSize​(int size)
      Sets the size of this event class, i.e.
      int size()
      Retrieves the size, i.e.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • index

        protected int index
        Unique index of class.
      • id

        protected java.lang.String id
        Unique identification string of class.
      • size

        protected int size
        Size of class, i.e. number of represented instances.
    • Constructor Detail

      • XEventClass

        public XEventClass​(java.lang.String id,
                           int index)
        Creates a new event class instance.
        Parameters:
        id - Unique identification string of the class, i.e. its name.
        index - Unique index of this event class.
    • Method Detail

      • getId

        public java.lang.String getId()
        Retrieves the name, i.e. unique identification string, of this event class.
        Returns:
        The name of this class, as a unique string.
      • getIndex

        public int getIndex()
        Returns the index of this event class.
        Returns:
        Unique index.
      • size

        public int size()
        Retrieves the size, i.e. the number of events represented by this event class.
        Returns:
        Size of this class.
      • setSize

        public void setSize​(int size)
        Sets the size of this event class, i.e. the number of represented instances.
        Parameters:
        size - Number of events in this class.
      • incrementSize

        public void incrementSize()
        Increments the size of this class by one, i.e. adds another event to the number of represented instances.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(XEventClass o)
        Specified by:
        compareTo in interface java.lang.Comparable<XEventClass>