Class Event

java.lang.Object
edu.fiu.jtlex.data.Event
All Implemented Interfaces:
IEvent

public class Event extends Object implements IEvent
Default implementation of IEvent.
Author:
arada002
  • Constructor Details

    • Event

      public Event​(int eID, IEvent.EventClass eventClass, String stem)
      Creates a new Event with the specified information.
      Parameters:
      eID - id of the event; may not be 0 or negative
      eventClass - the class of the entry may not be null
      stem - the stem attribute of the event; may not be empty string or all whitespace; may be null if stem is not included in annotation
      Throws:
      NullPointerException - if eventClass argument is null
      IllegalArgumentException - if the stem is empty or all whitespace or eID is 0 or negative
  • Method Details

    • getId

      public int getId()
      Description copied from interface: IEvent
      Returns the integer part of the eventId. Each event has to be identified by a unique ID number and String.
      Specified by:
      getId in interface IEvent
      Returns:
      Integer part of the eventID. May not be 0 or negative.
    • getIdStr

      public String getIdStr()
      Description copied from interface: IEvent
      Returns the full string representation of the eventID. Each event has to be identified by a unique ID number and String.
      Specified by:
      getIdStr in interface IEvent
      Returns:
      Full string representation of the eventID. May not return null.
    • getStem

      public String getStem()
      Description copied from interface: IEvent
      Returns the stem of the event.
      Specified by:
      getStem in interface IEvent
      Returns:
      the stem of the event. May return null if stem is not included in annotation
    • getEventClass

      public IEvent.EventClass getEventClass()
      Description copied from interface: IEvent
      Returns the event class to which the object belongs.
      Specified by:
      getEventClass in interface IEvent
      Returns:
      the event class to which the object belongs. May not return null.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toJSON

      public String toJSON()
      Description copied from interface: IEvent
      Returns the JSON (RFC 8259) representation of the event.
      Specified by:
      toJSON in interface IEvent
      Returns:
      the JSON (RFC 8259) representation of the event.
    • equals

      public boolean equals​(Object o)
      Overrides:
      equals in class Object
    • clone

      public Event clone()
      Specified by:
      clone in interface IEvent