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()
      Returns the unique ID number eventInstanceID.
      Specified by:
      getId in interface IInstance
      Specified by:
      getId in interface INode
      Returns:
      the unique ID number eventInstanceID.
    • getEvent

      public IEvent getEvent()
      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()
      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()
      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()
      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()
      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:
    • getPolarity

      public IInstance.Polarity 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:
      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()
      Returns the signal object, present if multiple event instances are created null if not defined, may not be less than 0
      Specified by:
      getSignal in interface IInstance
      Returns:
      the signal object, present if multiple event instances are created.
    • getCardinality

      public 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:
      getCardinality in interface IInstance
      Returns:
      the cardinality, only present if there is a signal that provides its value.
      See Also:
    • getType

      public IEvent.EventClass getType()
      Calls the event to which the instance is related, then returns the event class of the event instance.
      Specified by:
      getType in interface IInstance
      Specified by:
      getType in interface INode
      Returns:
      the event class of the event instance.
    • getIdStr

      public String getIdStr()
      Grabs the eventInstanceID, adds eiid to the front for the String format and returns.
      Specified by:
      getIdStr in interface IInstance
      Specified by:
      getIdStr in interface INode
      Returns:
      the eventInstanceID in string format.
    • addOutLink

      public void addOutLink(ILink link)
      Adds a link to the outLinks, set of links that have this node as an origin. May be null.
      Specified by:
      addOutLink in interface IInstance
      Specified by:
      addOutLink in interface INode
      Parameters:
      link - link to add
    • addInLink

      public void addInLink(ILink link)
      Adds a link to the inLinks, set of links that have this node as a target. May be null.
      Specified by:
      addInLink in interface IInstance
      Specified by:
      addInLink in interface INode
      Parameters:
      link - link to add
    • getOutLinks

      public Set<ILink> getOutLinks()
      Returns the outLinks, set of links that have this node as an origin.
      Specified by:
      getOutLinks in interface IInstance
      Specified by:
      getOutLinks in interface INode
      Returns:
      the outLinks, set of links that have this node as an origin.
    • getInLinks

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

      public void removeOutLink(ILink link)
      Removes a link from the outLinks, set of links that have this node as an origin. May be null.
      Specified by:
      removeOutLink in interface IInstance
      Specified by:
      removeOutLink in interface INode
      Parameters:
      link - link to remove
    • removeInLink

      public void removeInLink(ILink link)
      Removes a link from the outLinks, set of links that have this node as a target. May be null.
      Specified by:
      removeInLink in interface IInstance
      Specified by:
      removeInLink in interface INode
      Parameters:
      link - link to remove
    • toString

      public String toString()
      Returns the info of the Instance in String format.
      Overrides:
      toString in class Object
      Returns:
      the info of the Instance in String format.
    • toJSON

      public String toJSON()
      Converts the Instance and its info into JSON format.
      Specified by:
      toJSON in interface INode
      Returns:
      the JSON format of the Instance.
    • clone

      public Instance clone()
      Creates and returns a copy of the Instance.
      Specified by:
      clone in interface INode
      Returns:
      a copy of the Instance.