Class Instance

java.lang.Object
edu.fiu.jtlex.data.Instance
All Implemented Interfaces:
IInstance, INode

public class Instance extends Object implements IInstance
Default implementation of IMakeInstance.
Author:
arada002
  • Constructor Details

    • Instance

      public Instance​(int eventInstanceID, IEvent event, IInstance.Tense tense, IInstance.Aspect aspect, IInstance.Pos pos, IInstance.Polarity polarity, String modality, ISignal signal, String cardinality)
      Creates a new event Instance object.
      Parameters:
      eventInstanceID - a unique ID number may not be less than 1
      event - the even to which event instance is related
      tense - phrase tense may not be null
      aspect - phrase aspect may not be null
      pos - part of speech, syntactic category of phrase may not be null
      polarity - indicates whether the eventInstance phrase is negated may not be null
      modality - modal word that modifies the instance may be null
      signal - the signal object, present if multiple event instances are created null if not defined may not be less than 0
      cardinality - 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()
      Description copied from interface: INode
      Returns the integer part of the node ID. Each event has to be identified by a unique ID number.
      Specified by:
      getId in interface INode
      Returns:
      Integer part of the node ID. May not be 0 or negative.
    • getEvent

      public IEvent getEvent()
      Description copied from interface: IInstance
      Returns the ID of the event to which the instance is related.
      Specified by:
      getEvent in interface IInstance
      Returns:
      the ID of the event to which the instance is related. May not return less than 1.
    • getTense

      public IInstance.Tense getTense()
      Description copied from interface: IInstance
      Returns the tense of the verbal phrase.
      Specified by:
      getTense in interface IInstance
      Returns:
      the tense of the verbal phrase. May not return null.
    • getAspect

      public IInstance.Aspect getAspect()
      Description copied from interface: IInstance
      Returns the aspect of the verbal phrase.
      Specified by:
      getAspect in interface IInstance
      Returns:
      the aspect of the verbal phrase. May not return null.
    • getPos

      public IInstance.Pos getPos()
      Description copied from interface: IInstance
      Returns the syntactic category of the phrase (part of speech).
      Specified by:
      getPos in interface IInstance
      Returns:
      the syntactic category of the phrase (part of speech). May not return null.
    • getModality

      public String getModality()
      Description copied from interface: IInstance
      The modality attribute is only present if there is a modal word present that modifies the instance.
      Specified by:
      getModality in interface IInstance
      Returns:
      the modal word that modifies the instance. May return null.
      See Also:
      Modality (natural language)
    • getPolarity

      public IInstance.Polarity getPolarity()
      Description copied from interface: IInstance
      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:
      getPolarity in interface IInstance
      Returns:
      polarity: NEG if the phrase is negated, POS if the phrase is not negated. May not return null.
    • getSignal

      public ISignal getSignal()
      Description copied from interface: IInstance
      Returns the signal object.
      Specified by:
      getSignal in interface IInstance
      Returns:
      the signal object. May return null.
    • getCardinality

      public String getCardinality()
      Description copied from interface: IInstance
      Returns the cardinality of the event instance.
      Cardinality is only present if there is a signal that provides its value.
      There are also cases, where the annotator can either create as many MAKEINSTANCEs as motivated by the text or one MAKEINSTANCE which carries a cardinality value. Examples are the following:
      1. John taught twice on Monday.
      2. John taught 150 times last year.
      In the first example, the annotator can either create two MAKEINSTANCEs or one MAKEINSTANCE with cardinality two. In the second example, the only practical solution is to create one MAKEINSTANCE with cardinality 150.
      Specified by:
      getCardinality in interface IInstance
      Returns:
      Cardinality 0 if not defined. May not return less than 0.
      See Also:
      IInstance
    • getType

      public IEvent.EventClass getType()
      Description copied from interface: INode
      Return the integer that corresponds with the type. Each event can be categorized under three different types.
      Specified by:
      getType in interface INode
      Returns:
      Enum that corresponds with the type of node.
    • getIdStr

      public String getIdStr()
      Description copied from interface: INode
      Returns the full string representation of the node ID. Each event has to be identified by a unique ID number and String.
      Specified by:
      getIdStr in interface INode
      Returns:
      Full string representation of the node ID. May not return null.
    • addOutLink

      public void addOutLink​(ILink link)
      Description copied from interface: INode
      Add a link to the set of OUT links from this node.
      Specified by:
      addOutLink in interface INode
      Parameters:
      link - a new OUT link from this node.
    • addInLink

      public void addInLink​(ILink link)
      Description copied from interface: INode
      Add a link to the set of IN links from this node.
      Specified by:
      addInLink in interface INode
      Parameters:
      link - the link to the set of IN links from this node.
    • getOutLinks

      public Set<ILink> getOutLinks()
      Description copied from interface: INode
      Returns a set of links that have this node as a origin.
      Specified by:
      getOutLinks in interface INode
      Returns:
      a set of links that have this node as a origin.
    • getInLinks

      public Set<ILink> getInLinks()
      Description copied from interface: INode
      Returns a set of links that have this node as a target.
      Specified by:
      getInLinks in interface INode
      Returns:
      a set of links that have this node as a target.
    • removeOutLink

      public void removeOutLink​(ILink link)
      Description copied from interface: INode
      Removes a link that has this node as an origin.
      Specified by:
      removeOutLink in interface INode
      Parameters:
      link - a link that has this node as an origin.
    • removeInLink

      public void removeInLink​(ILink link)
      Description copied from interface: INode
      Removes a link that has this node as a target.
      Specified by:
      removeInLink in interface INode
      Parameters:
      link - a link that has this node as a target.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toJSON

      public String toJSON()
      Description copied from interface: INode
      Returns the JSON (RFC 8259) representation of the Node.
      Specified by:
      toJSON in interface INode
      Returns:
      the JSON (RFC 8259) representation of the Node.
    • equals

      public boolean equals​(Object o)
      Specified by:
      equals in interface INode
      Overrides:
      equals in class Object
    • clone

      public Instance clone()
      Specified by:
      clone in interface INode