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.ALinkType, ITimeMLLink.LinkTag, ITimeMLLink.Origintype, ITimeMLLink.SLinkType, ITimeMLLink.TLinkType -
Constructor Summary
ConstructorsConstructorDescriptionTimeMLLink(ITimeMLLink.LinkTag linktag, int linkID, String syntax, ITimeMLNode eventInstance, ITimeMLSignal signal, ITimeMLNode relatedToNode, ITimeMLLinkType relType) This is the constructor for Alink and SLinkTimeMLLink(ITimeMLLink.LinkTag linktag, int linkID, String syntax, ITimeMLNode eventInstance, ITimeMLSignal signal, ITimeMLNode relatedToNode, 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.booleanChecks if this link equals an object.Returns the ID of the event instance involved in the link.intReturns the ID of the link.Returns the type of Link.Returns whether a TLINK was generatedMANUALLYor 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.inthashCode()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.
-
Constructor Details
-
TimeMLLink
public TimeMLLink(ITimeMLLink.LinkTag linktag, int linkID, String syntax, ITimeMLNode eventInstance, ITimeMLSignal signal, ITimeMLNode relatedToNode, 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 != LinkTag.TLINK
-
TimeMLLink
public TimeMLLink(ITimeMLLink.LinkTag linktag, int linkID, String syntax, ITimeMLNode eventInstance, ITimeMLSignal signal, ITimeMLNode relatedToNode, 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 linktag == LinkTag.TLINK
-
-
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:
getLinkIDin 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:
getLinkTagin interfaceITimeMLLink- Returns:
ITimeMLLink.LinkTag.TLINK/ITimeMLLink.LinkTag.ALINK/ITimeMLLink.LinkTag.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:
getSyntaxin 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:
getEventInstancein 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:
getSignalin interfaceITimeMLLink- Returns:
- the optional ID of the relation signal.
- Since:
- jTLEX 1.0
-
getOrigin
Returns whether a TLINK was generatedMANUALLYor byCLOSURE.
THIS IS ONLY FOR TLINK Can be null.- Specified by:
getOriginin interfaceITimeMLLink- Returns:
- Whether link was generated
MANUALLYor 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:
getRelatedToNodein 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:
getRelTypein 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:
toStringin interfaceITimeMLLink- Overrides:
toStringin 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:
toJSONin 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:
clonein interfaceITimeMLLink- Returns:
- a copy of the Link.
- Since:
- jTLEX 1.0
-
hashCode
public int hashCode()Generates a hash code for the link.- Specified by:
hashCodein interfaceITimeMLLink- Overrides:
hashCodein classObject- Returns:
- The hash code.
- Since:
- jTLEX 1.0
-
equals
Checks if this link equals an object.- Specified by:
equalsin interfaceITimeMLLink- Overrides:
equalsin 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
-