Package edu.fiu.jtlex.timeml.data
Class TimeMLEvent
java.lang.Object
edu.fiu.jtlex.timeml.data.TimeMLEvent
- All Implemented Interfaces:
ITimeMLEvent
Default implementation of
ITimeMLEvent.- Since:
- jTLEX 1.0
- Author:
- arada002
-
Nested Class Summary
Nested classes/interfaces inherited from interface edu.fiu.jtlex.timeml.data.ITimeMLEvent
ITimeMLEvent.EventClass -
Constructor Summary
ConstructorsConstructorDescriptionTimeMLEvent(int eID, ITimeMLEvent.EventClass eventClass, String stem) Creates a new Event with the specified information. -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates and returns a field-by-field copy of the Event.booleanChecks if this event equals an object.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.Returns the instance related to the Event.getStem()Returns the stem of an Event.inthashCode()Generates a hash code for the event.voidsetInstance(ITimeMLInstance instance) Sets the related Instance for the event.toJSON()Converts the Event and it's info into JSON Format.toString()Returns the info of an Event in String Format.
-
Constructor Details
-
TimeMLEvent
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.- Specified by:
getIdin interfaceITimeMLEvent- Returns:
- the eID of an Event.
- Since:
- jTLEX 1.0
-
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:
getIdStrin interfaceITimeMLEvent- Returns:
- the eID of an Event in String format.
- Since:
- jTLEX 1.0
-
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:
getStemin interfaceITimeMLEvent- Returns:
- the stem of an Event.
- Since:
- jTLEX 1.0
-
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 interfaceITimeMLEvent- Returns:
- the event class of an Event.
- Since:
- jTLEX 1.0
-
toString
Returns the info of an Event in String Format. Will never return a null string.- Specified by:
toStringin interfaceITimeMLEvent- Overrides:
toStringin classObject- Returns:
- the info of an Event in String Format.
- Since:
- jTLEX 1.0
-
setInstance
Sets the related Instance for the event. May be null.- Specified by:
setInstancein interfaceITimeMLEvent- Parameters:
instance- theITimeMLInstanceto connect to the event.- Since:
- jTLEX 1.0
-
getInstances
Returns the instance related to the Event. May be null.- Specified by:
getInstancesin interfaceITimeMLEvent- Returns:
- the IInstances related to the event.
- Since:
- jTLEX 1.0
-
toJSON
Converts the Event and it's info into JSON Format. Will never return a null string.- Specified by:
toJSONin interfaceITimeMLEvent- Returns:
- the JSON format of an Event.
- Since:
- jTLEX 1.0
-
clone
Creates and returns a field-by-field copy of the Event. Will never return a null or empty Event object.- Specified by:
clonein interfaceITimeMLEvent- Returns:
- a copy of an Event.
- Since:
- jTLEX 1.0
-
hashCode
public int hashCode()Generates a hash code for the event.- Specified by:
hashCodein interfaceITimeMLEvent- Overrides:
hashCodein classObject- Returns:
- The hash code.
- Since:
- jTLEX 1.0
-
equals
Checks if this event equals an object.- Specified by:
equalsin interfaceITimeMLEvent- Overrides:
equalsin classObject- Parameters:
o- The object to compare against.- Returns:
- True if both events are equal, i.e. same ID and eventClass, or else false.
- Throws:
NullPointerException- If the object to compare against is false.- Since:
- jTLEX 1.0
-