Package edu.fiu.jtlex.data
Class Link
java.lang.Object
edu.fiu.jtlex.data.Link
- All Implemented Interfaces:
ILink
public class Link extends java.lang.Object implements ILink
Default implementation of
ILink.- 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
Constructors Constructor Description Link(ILink.LinkTag linktag, int linkID, java.lang.String syntax, INode eventInstance, ISignal signal, INode relatedToNode, ILinkType relType)This is the constructor for Alink and SLinkLink(ILink.LinkTag linktag, int linkID, java.lang.String syntax, INode eventInstance, ISignal signal, INode relatedToNode, ILinkType relType, ILink.Origintype orig)This is the constructor for Tlink. -
Method Summary
Modifier and Type Method Description Linkclone()Returns a deep copy of the Link.INodegetEventInstance()Returns the ID of the event instance involved in the link.intgetLinkID()Returns the ID of the link.ILink.LinkTaggetLinkTag()Returns the type of Link.ILink.OrigintypegetOrigin()Returns whether a TLINK was generatedMANUALLYor byCLOSURE.INodegetRelatedToNode()Returns the ID of the entity that is being related to the event instance with ID=eventInstanceID or time expression with ID=timeID.ILinkTypegetRelType()This is the temporal relation holding between the entities.ISignalgetSignal()Returns the ID of the relation signal.java.lang.StringgetSyntax()Returns the syntax of the link.inthashCode()Gets the links hash codejava.lang.StringtoJSON()Returns the JSON (RFC 8259) representation of the Link.java.lang.StringtoString()Converts the Link to a String
-
Constructor Details
-
Link
public Link(ILink.LinkTag linktag, int linkID, java.lang.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:
java.lang.NullPointerException- if TLinkRelType argument is nulljava.lang.IllegalArgumentException- throw error if linktag != LinkTag.TLINK
-
Link
public Link(ILink.LinkTag linktag, int linkID, java.lang.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:
java.lang.NullPointerException- if ALinkRelType argument is nulljava.lang.IllegalArgumentException- 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 -
getLinkTag
Returns the type of Link.- Specified by:
getLinkTagin interfaceILink- Returns:
ILink.LinkTag.TLINK/ILink.LinkTag.ALINK/ILink.LinkTag.SLINK
-
getSyntax
public java.lang.String 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). -
getEventInstance
Returns the ID of the event instance involved in the link. OBLIGATORY- Specified by:
getEventInstancein interfaceILink- Returns:
- the ID of the event instance involved in the link.
-
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. -
getOrigin
Returns whether a TLINK was generatedMANUALLYor byCLOSURE.
THIS IS ONLY FOR TLINK -
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.- 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.
-
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.- Specified by:
getRelTypein interfaceILink- Returns:
ALinkRelType/SLinkRelType/TLinkRelType- See Also:
ILink.ALinkType,ILink.SLinkType,ILink.TLinkType
-
hashCode
public int hashCode()Gets the links hash code -
toString
public java.lang.String toString()Converts the Link to a String- Overrides:
toStringin classjava.lang.Object- Returns:
- String
-
toJSON
public java.lang.String toJSON()Returns the JSON (RFC 8259) representation of the Link. -
clone
Returns a deep copy of the Link.
-