Package edu.fiu.jtlex.timeml.data
Class TimeMLInstance
java.lang.Object
edu.fiu.jtlex.timeml.data.TimeMLInstance
- All Implemented Interfaces:
ITimeMLInstance
,ITimeMLNode
Default implementation of
IMakeInstance
.- Since:
- jTLEX 1.0
- Author:
- arada002
-
Nested Class Summary
Nested classes/interfaces inherited from interface edu.fiu.jtlex.timeml.data.ITimeMLInstance
ITimeMLInstance.Aspect, ITimeMLInstance.Polarity, ITimeMLInstance.Pos, ITimeMLInstance.Tense
Nested classes/interfaces inherited from interface edu.fiu.jtlex.timeml.graph.ITimeMLNode
ITimeMLNode.IType
-
Constructor Summary
ConstructorsConstructorDescriptionTimeMLInstance
(int eventInstanceID, ITimeMLEvent event, ITimeMLInstance.Tense tense, ITimeMLInstance.Aspect aspect, ITimeMLInstance.Pos pos, ITimeMLInstance.Polarity polarity, String modality, ITimeMLSignal signal, String cardinality) Creates a new event Instance object. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Creates and returns a field-by-field copy of the Instance.boolean
Checks if this instance equals an object.Returns the aspect of the verbal phrase.Returns the cardinality, only present if there is a signal that provides its value.getEvent()
Returns the ID of the event to which the instance is related.int
getId()
Returns the unique ID number eventInstanceID.getIdStr()
Grabs the eventInstanceID, adds eiid to the front for the String format and returns.The modality attribute is only present if there is a modal word present that modifies the instance.Returns the polarity of the eventInstance.getPos()
Returns the syntactic category of the phrase (part of speech).Returns the signal object, present if multiple event instances are creatednull
if not defined, may not be less than 0getTense()
Returns the tense of the verbal phrase.getType()
Calls the event to which the instance is related, then returns the event class of the event instance.toJson()
Converts the Instance and its info into JSON format.toString()
Returns the info of the Instance in String format.
-
Constructor Details
-
TimeMLInstance
public TimeMLInstance(int eventInstanceID, ITimeMLEvent event, ITimeMLInstance.Tense tense, ITimeMLInstance.Aspect aspect, ITimeMLInstance.Pos pos, ITimeMLInstance.Polarity polarity, String modality, ITimeMLSignal signal, String cardinality) Creates a new event Instance object.- Parameters:
eventInstanceID
- a unique ID number may not be less than 1event
- the even to which event instance is relatedtense
- phrase tense may not benull
aspect
- phrase aspect may not benull
pos
- part of speech, syntactic category of phrase may not benull
polarity
- indicates whether the eventInstance phrase is negated may not benull
modality
- modal word that modifies the instance may benull
signal
- the signal object, present if multiple event instances are creatednull
if not defined may not be less than 0cardinality
- only present if there is a signal that provides its value 0 if not defined may not be less than 0- Throws:
NullPointerException
- if Event, Tense, Aspect, Pos, or Polarity are nullIllegalArgumentException
- if Modality is empty or all whitespace
-
-
Method Details
-
getId
public int getId()Returns the unique ID number eventInstanceID.- Specified by:
getId
in interfaceITimeMLInstance
- Specified by:
getId
in interfaceITimeMLNode
- Returns:
- the unique ID number eventInstanceID.
- Since:
- jTLEX 1.0
-
getEvent
Returns the ID of the event to which the instance is related.- Specified by:
getEvent
in interfaceITimeMLInstance
- Returns:
- the ID of the event to which the instance is related.
- Since:
- jTLEX 1.0
-
getTense
Returns the tense of the verbal phrase.- Specified by:
getTense
in interfaceITimeMLInstance
- Returns:
- the tense of the verbal phrase.
May not return
null
. - Since:
- jTLEX 1.0
-
getAspect
Returns the aspect of the verbal phrase.- Specified by:
getAspect
in interfaceITimeMLInstance
- Returns:
- the aspect of the verbal phrase.
May not return
null
. - Since:
- jTLEX 1.0
-
getPos
Returns the syntactic category of the phrase (part of speech).- Specified by:
getPos
in interfaceITimeMLInstance
- Returns:
- the syntactic category of the phrase (part of speech).
May not return
null
. - Since:
- jTLEX 1.0
-
getModality
The modality attribute is only present if there is a modal word present that modifies the instance.- Specified by:
getModality
in interfaceITimeMLInstance
- Returns:
- the modal word that modifies the instance.
May return
null
. - Since:
- jTLEX 1.0
- See Also:
-
getPolarity
Returns the polarity of the eventInstance. The polarity of an event instance is a required attribute represented by the boolean attribute, polarity.
If it is set to NEG, the event instance is negated.
If it is set to POS or not present in the annotation, the event instance is not negated.- Specified by:
getPolarity
in interfaceITimeMLInstance
- Returns:
- polarity:
NEG if the phrase is negated,
POS if the phrase is not negated.
May not return
null
. - Since:
- jTLEX 1.0
-
getSignal
Returns the signal object, present if multiple event instances are creatednull
if not defined, may not be less than 0- Specified by:
getSignal
in interfaceITimeMLInstance
- Returns:
- the signal object, present if multiple event instances are created.
- Since:
- jTLEX 1.0
-
getCardinality
Returns the cardinality, only present if there is a signal that provides its value. 0 if not defined, may not be less than 0.- Specified by:
getCardinality
in interfaceITimeMLInstance
- Returns:
- the cardinality, only present if there is a signal that provides its value.
- Since:
- jTLEX 1.0
- See Also:
-
getType
Calls the event to which the instance is related, then returns the event class of the event instance.- Specified by:
getType
in interfaceITimeMLInstance
- Specified by:
getType
in interfaceITimeMLNode
- Returns:
- the event class of the event instance.
- Since:
- jTLEX 1.0
-
getIdStr
Grabs the eventInstanceID, adds eiid to the front for the String format and returns.- Specified by:
getIdStr
in interfaceITimeMLInstance
- Specified by:
getIdStr
in interfaceITimeMLNode
- Returns:
- the eventInstanceID in string format.
- Since:
- jTLEX 1.0
-
toString
Returns the info of the Instance in String format. -
toJson
Converts the Instance and its info into JSON format.- Specified by:
toJson
in interfaceITimeMLNode
- Returns:
- the JSON format of the Instance.
- Since:
- jTLEX 1.0
-
clone
Creates and returns a field-by-field copy of the Instance.- Specified by:
clone
in interfaceITimeMLNode
- Overrides:
clone
in classObject
- Returns:
- a copy of the Instance.
- Since:
- jTLEX 1.0
-
equals
Checks if this instance equals an object.- Specified by:
equals
in interfaceITimeMLInstance
- Specified by:
equals
in interfaceITimeMLNode
- Overrides:
equals
in classObject
- Parameters:
o
- The object to compare against.- Returns:
- True if both instances are equal, i.e. same ID and event, or else false.
- Throws:
NullPointerException
- If the object to compare against is false.- Since:
- jTLEX 1.0
-