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.
Since:
Revision 30
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, must be an integer
      eventClass - the class of the entry may not be null, must be an EventClass enum
      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/negative/not an integer or if the eventClass is not an enum.
  • Method Details

    • getId

      public int getId()
      Returns the eID of an Event. eID must always be an integer greater than 0. Will never return null as the Event constructor requires a valid eID for the object to be created.
      Specified by:
      getId in interface IEvent
      Returns:
      the eID of an Event.
      Since:
      Revision 30
    • getIdStr

      public String getIdStr()
      Grabs the eID, adds an e to the front for String format and returns. Will never return null as the Event constructor requires a valid eID for the object to be created.
      Specified by:
      getIdStr in interface IEvent
      Returns:
      the eID of an Event in String format.
      Since:
      Revision 31
    • getStem

      public String getStem()
      Returns the stem of an Event. Will never return null as the Event constructor checks for a valid stem while creating the Event object.
      Specified by:
      getStem in interface IEvent
      Returns:
      the stem of an Event.
      Since:
      Revision 30
    • getEventClass

      public IEvent.EventClass getEventClass()
      Returns the event class of an Event. Will never return null as the Event Constructor requires an Event Class while creating the object.
      Specified by:
      getEventClass in interface IEvent
      Returns:
      the event class of an Event.
      Since:
      Revision 30
    • toString

      public String toString()
      Returns the info of an Event in String Format. Will never return a null string.
      Specified by:
      toString in interface IEvent
      Overrides:
      toString in class Object
      Returns:
      the info of an Event in String Format.
      Since:
      Revision 30
    • toJSON

      public String toJSON()
      Converts the Event and it's info into JSON Format. Will never return a null string.
      Specified by:
      toJSON in interface IEvent
      Returns:
      the JSON format of an Event.
      Since:
      Revision 391
    • clone

      public Event clone()
      Creates and returns a deep copy of the Event. Will never return a null or empty Event object.
      Specified by:
      clone in interface IEvent
      Returns:
      a deep copy of an Event.
      Since:
      Revision 394