Package edu.fiu.jtlex.data
Class Link
java.lang.Object
edu.fiu.jtlex.data.Link
- All Implemented Interfaces:
ILink
Default implementation of
ILink.- Since:
- Revision 42
- Author:
- Pablo Maldonado
-
Nested Class Summary
Nested classes/interfaces inherited from interface edu.fiu.jtlex.data.ILink
ILink.ALinkType, ILink.LinkTag, ILink.Origintype, ILink.SLinkType, ILink.TLinkType -
Constructor Summary
ConstructorsConstructorDescriptionLink(ILink.LinkTag linktag, int linkID, String syntax, INode eventInstance, ISignal signal, INode relatedToNode, ILinkType relType) This is the constructor for Alink and SLinkLink(ILink.LinkTag linktag, int linkID, String syntax, INode eventInstance, ISignal signal, INode relatedToNode, ILinkType relType, ILink.Origintype orig) This is the constructor for Tlink. -
Method Summary
Modifier and TypeMethodDescriptionclone()Returns a deep copy of the Link.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()Gets the links hash code Cannot return null due to grabbing from variables required in constructor.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
-
Link
public Link(ILink.LinkTag linktag, int linkID, String syntax, INode eventInstance, ISignal signal, INode relatedToNode, ILinkType relType, ILink.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
-
Link
public Link(ILink.LinkTag linktag, int linkID, String syntax, INode eventInstance, ISignal signal, INode relatedToNode, ILinkType 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. -
getLinkTag
Returns the type of Link. Will never return null due to constructor.- Specified by:
getLinkTagin interfaceILink- Returns:
ILink.LinkTag.TLINK/ILink.LinkTag.ALINK/ILink.LinkTag.SLINK- Since:
- Revision 42
-
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. -
getEventInstance
Returns the ID of the event instance involved in the link. OBLIGATORY, cannot be null- Specified by:
getEventInstancein interfaceILink- Returns:
- the ID of the event instance involved in the link.
- Since:
- Revision 42
-
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. -
getOrigin
Returns whether a TLINK was generatedMANUALLYor byCLOSURE.
THIS IS ONLY FOR TLINK Can be null. -
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 interfaceILink- Returns:
- the ID of the entity that is being related to the event instance with ID=eventInstanceID or time expression with ID=timeID.
- Since:
- Revision 394
-
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 interfaceILink- Returns:
ALinkRelType/SLinkRelType/TLinkRelType- Since:
- Revision 42
- See Also:
-
hashCode
public int hashCode()Gets the links hash code Cannot return null due to grabbing from variables required in constructor. -
toString
Converts the Link to a String Cannot be null due to requiring items from constructor. -
toJSON
Returns the JSON (RFC 8259) representation of the Link. Cannot be null due to requiring items from constructor. -
clone
Returns a deep copy of the Link. Cannot be null due to requiring items from constructor.
-