Package edu.fiu.jtlex.data
Class Instance
java.lang.Object
edu.fiu.jtlex.data.Instance
public class Instance extends java.lang.Object implements IInstance
Default implementation of
IMakeInstance.- Author:
- arada002
-
Nested Class Summary
Nested classes/interfaces inherited from interface edu.fiu.jtlex.data.IInstance
IInstance.Aspect, IInstance.Polarity, IInstance.Pos, IInstance.Tense -
Constructor Summary
Constructors Constructor Description Instance(int eventInstanceID, IEvent event, IInstance.Tense tense, IInstance.Aspect aspect, IInstance.Pos pos, IInstance.Polarity polarity, java.lang.String modality, ISignal signal, java.lang.String cardinality)Creates a new event Instance object. -
Method Summary
Modifier and Type Method Description voidaddInLink(ILink link)Adds a link to the inLinks, set of links that have this node as a target.voidaddOutLink(ILink link)Adds a link to the outLinks, set of links that have this node as an origin.Instanceclone()Creates and returns a copy of the Instance.IInstance.AspectgetAspect()Returns the aspect of the verbal phrase.java.lang.StringgetCardinality()Returns the cardinality, only present if there is a signal that provides its value.IEventgetEvent()Returns the ID of the event to which the instance is related.intgetId()Returns the unique ID number eventInstanceID.java.lang.StringgetIdStr()Grabs the eventInstanceID, adds eiid to the front for the String format and returns.java.util.Set<ILink>getInLinks()Returns the inLinks, set of links that have this node as a target.java.lang.StringgetModality()The modality attribute is only present if there is a modal word present that modifies the instance.java.util.Set<ILink>getOutLinks()Returns the outLinks, set of links that have this node as an origin.IInstance.PolaritygetPolarity()Returns the polarity of the eventInstance.IInstance.PosgetPos()Returns the syntactic category of the phrase (part of speech).ISignalgetSignal()Returns the signal object, present if multiple event instances are creatednullif not defined, may not be less than 0IInstance.TensegetTense()Returns the tense of the verbal phrase.IEvent.EventClassgetType()Calls the event to which the instance is related, then returns the event class of the event instance.voidremoveInLink(ILink link)Removes a link from the outLinks, set of links that have this node as a target.voidremoveOutLink(ILink link)Removes a link from the outLinks, set of links that have this node as an origin.java.lang.StringtoJSON()Converts the Instance and its info into JSON format.java.lang.StringtoString()Returns the info of the Instance in String format.
-
Constructor Details
-
Instance
public Instance(int eventInstanceID, IEvent event, IInstance.Tense tense, IInstance.Aspect aspect, IInstance.Pos pos, IInstance.Polarity polarity, java.lang.String modality, ISignal signal, java.lang.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 benullaspect- phrase aspect may not benullpos- part of speech, syntactic category of phrase may not benullpolarity- indicates whether the eventInstance phrase is negated may not benullmodality- modal word that modifies the instance may benullsignal- the signal object, present if multiple event instances are creatednullif 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
-
-
Method Details
-
getId
public int getId()Returns the unique ID number eventInstanceID. -
getEvent
Returns the ID of the event to which the instance is related. -
getTense
Returns the tense of the verbal phrase. -
getAspect
Returns the aspect of the verbal phrase. -
getPos
Returns the syntactic category of the phrase (part of speech). -
getModality
public java.lang.String getModality()The modality attribute is only present if there is a modal word present that modifies the instance.- Specified by:
getModalityin interfaceIInstance- Returns:
- the modal word that modifies the instance.
May return
null. - See Also:
- Modality (natural language)
-
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:
getPolarityin interfaceIInstance- Returns:
- polarity:
NEG if the phrase is negated,
POS if the phrase is not negated.
May not return
null.
-
getSignal
Returns the signal object, present if multiple event instances are creatednullif not defined, may not be less than 0 -
getCardinality
public java.lang.String 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:
getCardinalityin interfaceIInstance- Returns:
- the cardinality, only present if there is a signal that provides its value.
- See Also:
IInstance
-
getType
Calls the event to which the instance is related, then returns the event class of the event instance. -
getIdStr
public java.lang.String getIdStr()Grabs the eventInstanceID, adds eiid to the front for the String format and returns. -
addOutLink
Adds a link to the outLinks, set of links that have this node as an origin.- Specified by:
addOutLinkin interfaceIInstance- Specified by:
addOutLinkin interfaceINode- Parameters:
link- link to add
-
addInLink
Adds a link to the inLinks, set of links that have this node as a target. -
getOutLinks
Returns the outLinks, set of links that have this node as an origin.- Specified by:
getOutLinksin interfaceIInstance- Specified by:
getOutLinksin interfaceINode- Returns:
- the outLinks, set of links that have this node as an origin.
-
getInLinks
Returns the inLinks, set of links that have this node as a target.- Specified by:
getInLinksin interfaceIInstance- Specified by:
getInLinksin interfaceINode- Returns:
- the inLinks, set of links that have this node as a target.
-
removeOutLink
Removes a link from the outLinks, set of links that have this node as an origin.- Specified by:
removeOutLinkin interfaceIInstance- Specified by:
removeOutLinkin interfaceINode- Parameters:
link- link to remove
-
removeInLink
Removes a link from the outLinks, set of links that have this node as a target.- Specified by:
removeInLinkin interfaceIInstance- Specified by:
removeInLinkin interfaceINode- Parameters:
link- link to remove
-
toString
public java.lang.String toString()Returns the info of the Instance in String format.- Overrides:
toStringin classjava.lang.Object- Returns:
- the info of the Instance in String format.
-
toJSON
public java.lang.String toJSON()Converts the Instance and its info into JSON format. -
clone
Creates and returns a copy of the Instance.
-