Package edu.fiu.jtlex.data
Class Event
java.lang.Object
edu.fiu.jtlex.data.Event
- All Implemented Interfaces:
IEvent
Default implementation of
IEvent.- Since:
- Revision 30
- Author:
- arada002
-
Nested Class Summary
Nested classes/interfaces inherited from interface edu.fiu.jtlex.data.IEvent
IEvent.EventClass -
Constructor Summary
ConstructorsConstructorDescriptionEvent(int eID, IEvent.EventClass eventClass, String stem) Creates a new Event with the specified information. -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates and returns a deep copy of the Event.Returns the event class of an Event.intgetId()Returns the eID of an Event.getIdStr()Grabs the eID, adds an e to the front for String format and returns.getStem()Returns the stem of an Event.toJSON()Converts the Event and it's info into JSON Format.toString()Returns the info of an Event in String Format.
-
Constructor Details
-
Event
Creates a new Event with the specified information.- Parameters:
eID- id of the event; may not be 0 or negative, must be an integereventClass- the class of the entry may not benull, must be an EventClass enumstem- the stem attribute of the event; may not be empty string or all whitespace; may benullif stem is not included in annotation- Throws:
NullPointerException- if eventClass argument isnullIllegalArgumentException- 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. -
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. -
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. -
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:
getEventClassin interfaceIEvent- Returns:
- the event class of an Event.
- Since:
- Revision 30
-
toString
Returns the info of an Event in String Format. Will never return a null string. -
toJSON
Converts the Event and it's info into JSON Format. Will never return a null string. -
clone
Creates and returns a deep copy of the Event. Will never return a null or empty Event object.
-