Class Event

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

public class Event
extends java.lang.Object
implements IEvent
Default implementation of IEvent.
Author:
arada002
  • Nested Class Summary

    Nested classes/interfaces inherited from interface edu.fiu.jtlex.data.IEvent

    IEvent.EventClass
  • Constructor Summary

    Constructors 
    Constructor Description
    Event​(int eID, IEvent.EventClass eventClass, java.lang.String stem)
    Creates a new Event with the specified information.
  • Method Summary

    Modifier and Type Method Description
    Event clone()
    Creates and returns a deep copy of the Event.
    IEvent.EventClass getEventClass()
    Returns the event class of an Event.
    int getId()
    Returns the eID of an Event.
    java.lang.String getIdStr()
    Grabs the eID, adds an e to the front for String format and returns.
    java.lang.String getStem()
    Returns the stem of an Event.
    java.lang.String toJSON()
    Converts the Event and it's info into JSON Format.
    java.lang.String toString()
    Returns the info of an Event in String Format.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Event

      public Event​(int eID, IEvent.EventClass eventClass, java.lang.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:
      java.lang.NullPointerException - if eventClass argument is null
      java.lang.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.
      Specified by:
      getId in interface IEvent
      Returns:
      the eID of an Event.
    • getIdStr

      public java.lang.String getIdStr()
      Grabs the eID, adds an e to the front for String format and returns.
      Specified by:
      getIdStr in interface IEvent
      Returns:
      the eID of an Event in String format.
    • getStem

      public java.lang.String getStem()
      Returns the stem of an Event.
      Specified by:
      getStem in interface IEvent
      Returns:
      the stem of an Event.
    • getEventClass

      public IEvent.EventClass getEventClass()
      Returns the event class of an Event.
      Specified by:
      getEventClass in interface IEvent
      Returns:
      the event class of an Event.
    • toString

      public java.lang.String toString()
      Returns the info of an Event in String Format.
      Overrides:
      toString in class java.lang.Object
      Returns:
      the info of an Event in String Format.
    • toJSON

      public java.lang.String toJSON()
      Converts the Event and it's info into JSON Format.
      Specified by:
      toJSON in interface IEvent
      Returns:
      the JSON format of an Event.
    • clone

      public Event clone()
      Creates and returns a deep copy of the Event.
      Specified by:
      clone in interface IEvent
      Returns:
      a deep copy of an Event.