Package edu.fiu.jtlex.timeml.data
Class TimeMLLink
java.lang.Object
edu.fiu.jtlex.timeml.data.TimeMLLink
- All Implemented Interfaces:
ITimeMLLink
Default implementation of
ILink
.- Since:
- jTLEX 1.0
- Author:
- Pablo Maldonado
-
Nested Class Summary
Nested classes/interfaces inherited from interface edu.fiu.jtlex.timeml.data.ITimeMLLink
ITimeMLLink.ALink, ITimeMLLink.ITimeMLLinkType, ITimeMLLink.Origintype, ITimeMLLink.SLink, ITimeMLLink.TLink
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTimeMLLink
(Class<?> linktag, int linkID, String syntax, ITimeMLNode eventInstance, ITimeMLSignal signal, ITimeMLNode relatedToNode, ITimeMLLink.ITimeMLLinkType relType) This is the constructor for Alink and SLinkTimeMLLink
(Class<?> linktag, int linkID, String syntax, ITimeMLNode eventInstance, ITimeMLSignal signal, ITimeMLNode relatedToNode, ITimeMLLink.ITimeMLLinkType relType, ITimeMLLink.Origintype orig) This is the constructor for Tlink. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns a field-by-field copy of the Link.boolean
Checks if this link equals an object.Returns the ID of the event instance involved in the link.int
Returns the ID of the link.Returns the type of Link.Returns whether a TLINK was generatedMANUALLY
or byCLOSURE
.Returns the ID of the entity that is being related to the event instance with ID=eventInstanceID or time expression with ID=timeID.This is the temporal relation holding between the entities.Returns the ID of the relation signal.Returns the syntax of the link.int
hashCode()
Generates a hash code for the link.toJson()
Returns the JSON (RFC 8259) representation of the Link.toString()
Converts the Link to a String Cannot be null due to requiring items from constructor.
-
Field Details
-
linktag
-
-
Constructor Details
-
TimeMLLink
public TimeMLLink(Class<?> linktag, int linkID, String syntax, ITimeMLNode eventInstance, ITimeMLSignal signal, ITimeMLNode relatedToNode, ITimeMLLink.ITimeMLLinkType relType, ITimeMLLink.Origintype orig) This is the constructor for Tlink.- Parameters:
linktag
- linkTag is the type of Link: TLINKlinkID
- Link ID gives each TimeML link an identification numbersyntax
- syntax holds any syntactic pattern that was used in generating the linkeventInstance
- Obligatory attribute (one or the other of these needs to be present). This is the ID of the eventInstance or the timeID involved in the temporal link.signal
- Optional attribute. If the temporal relation holding between the entities is explicitly signaled in the text, then the ID of that signal needs to be supplied here.relatedToNode
- Obligatory attribute (one or the other of these needs to be present). This is the ID of the entity that is being related to the event instance with ID=eventInstanceID or time expression with ID=timeID.relType
- Obligatory attribute. This is the temporal relation holding between the entities.orig
- Optional attribute. This attribute shows whether a TLINK was generated manually or by closure.- Throws:
NullPointerException
- if TLinkRelType argument is nullIllegalArgumentException
- throw error if linktag is not the TLink Class
-
TimeMLLink
public TimeMLLink(Class<?> linktag, int linkID, String syntax, ITimeMLNode eventInstance, ITimeMLSignal signal, ITimeMLNode relatedToNode, ITimeMLLink.ITimeMLLinkType relType) This is the constructor for Alink and SLink- Parameters:
linktag
- linkTag is the type of Link: SLINK or ALINKlinkID
- Link ID gives each TimeML link an identification numbersyntax
- syntax holds any syntactic pattern that was used in generating the linkeventInstance
- Obligatory attribute. This is the ID of the (aspectual) eventInstance involved in the aspectual link.signal
- Optional attribute. If the aspectual relation holding between the events is explicitly signaled in the text, then the ID of that signal needs to be filled in hererelatedToNode
- Obligatory attribute. This is the ID of the event instance related to the aspectual event.relType
- Obligatory attribute. This is the temporal relation holding between the entities for Alink- Throws:
NullPointerException
- if ALinkRelType argument is nullIllegalArgumentException
- throw error if it is not an ALink or SLink class
-
-
Method Details
-
getLinkID
public int getLinkID()Returns the ID of the link.
Link ID gives each TimeML link an identification number Can be null.- Specified by:
getLinkID
in interfaceITimeMLLink
- Returns:
- the ID of the link.
- Since:
- jTLEX 1.0
-
getLinkTag
Returns the type of Link. Will never return null due to constructor.- Specified by:
getLinkTag
in interfaceITimeMLLink
- Returns:
ITimeMLLink.TLink
/ITimeMLLink.ALink
/ITimeMLLink.SLink
- Since:
- jTLEX 1.0
-
getSyntax
Returns the syntax of the link.
Syntax holds any syntactic pattern that was used in generating the link (e.g. from an automatic annotation tool).
Can be null.- Specified by:
getSyntax
in interfaceITimeMLLink
- Returns:
- the syntax of the link.
- Since:
- jTLEX 1.0
-
getEventInstance
Returns the ID of the event instance involved in the link. OBLIGATORY, cannot be null- Specified by:
getEventInstance
in interfaceITimeMLLink
- Returns:
- the ID of the event instance involved in the link.
- Since:
- jTLEX 1.0
-
getSignal
Returns the ID of the relation signal.
If the temporal relation holding between the entities is explicitly signaled in the text, then the ID of that signal needs to be supplied here.
Can be null.- Specified by:
getSignal
in interfaceITimeMLLink
- Returns:
- the optional ID of the relation signal.
- Since:
- jTLEX 1.0
-
getOrigin
Returns whether a TLINK was generatedMANUALLY
or byCLOSURE
.
THIS IS ONLY FOR TLINK Can be null.- Specified by:
getOrigin
in interfaceITimeMLLink
- Returns:
- Whether link was generated
MANUALLY
or byCLOSURE
- Since:
- jTLEX 1.0
-
getRelatedToNode
Returns the ID of the entity that is being related to the event instance with ID=eventInstanceID or time expression with ID=timeID.
relatedToEventInstance or relatedToTime needs to be present. Cannot be null due to constructor.- Specified by:
getRelatedToNode
in interfaceITimeMLLink
- Returns:
- the ID of the entity that is being related to the event instance with ID=eventInstanceID or time expression with ID=timeID.
- Since:
- jTLEX 1.0
-
getRelType
This is the temporal relation holding between the entities.
These are represented by 3 different enums:- ALinkRelType
- SLinkRelType
- TLinkRelType
The returned type depends on the linkTag. Cannot be null due to constructor.- Specified by:
getRelType
in interfaceITimeMLLink
- Returns:
ALinkRelType
/SLinkRelType
/TLinkRelType
- Since:
- jTLEX 1.0
- See Also:
-
toString
Converts the Link to a String Cannot be null due to requiring items from constructor.- Specified by:
toString
in interfaceITimeMLLink
- Overrides:
toString
in classObject
- Returns:
- String
- Since:
- jTLEX 1.0
-
toJson
Returns the JSON (RFC 8259) representation of the Link. Cannot be null due to requiring items from constructor.- Specified by:
toJson
in interfaceITimeMLLink
- Returns:
- the JSON (RFC 8259) representation of the Link.
- Since:
- jTLEX 1.0
-
clone
Returns a field-by-field copy of the Link. Cannot be null due to requiring items from constructor.- Specified by:
clone
in interfaceITimeMLLink
- Overrides:
clone
in classObject
- Returns:
- a copy of the Link.
- Since:
- jTLEX 1.0
-
hashCode
public int hashCode()Generates a hash code for the link.- Specified by:
hashCode
in interfaceITimeMLLink
- Overrides:
hashCode
in classObject
- Returns:
- The hash code.
- Since:
- jTLEX 1.0
-
equals
Checks if this link equals an object.- Specified by:
equals
in interfaceITimeMLLink
- Overrides:
equals
in classObject
- Parameters:
o
- The object to compare against.- Returns:
- True if both links are equal, i.e. same ID and tag, or else false.
- Throws:
NullPointerException
- If the object to compare against is false.- Since:
- jTLEX 1.0
-