Class Instance

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

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
    void addInLink​(ILink link)
    Adds a link to the inLinks, set of links that have this node as a target.
    void addOutLink​(ILink link)
    Adds a link to the outLinks, set of links that have this node as an origin.
    Instance clone()
    Creates and returns a copy of the Instance.
    IInstance.Aspect getAspect()
    Returns the aspect of the verbal phrase.
    java.lang.String getCardinality()
    Returns the cardinality, only present if there is a signal that provides its value.
    IEvent getEvent()
    Returns the ID of the event to which the instance is related.
    int getId()
    Returns the unique ID number eventInstanceID.
    java.lang.String getIdStr()
    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.String getModality()
    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.Polarity getPolarity()
    Returns the polarity of the eventInstance.
    IInstance.Pos getPos()
    Returns the syntactic category of the phrase (part of speech).
    ISignal getSignal()
    Returns the signal object, present if multiple event instances are created null if not defined, may not be less than 0
    IInstance.Tense getTense()
    Returns the tense of the verbal phrase.
    IEvent.EventClass getType()
    Calls the event to which the instance is related, then returns the event class of the event instance.
    void removeInLink​(ILink link)
    Removes a link from the outLinks, set of links that have this node as a target.
    void removeOutLink​(ILink link)
    Removes a link from the outLinks, set of links that have this node as an origin.
    java.lang.String toJSON()
    Converts the Instance and its info into JSON format.
    java.lang.String toString()
    Returns the info of the Instance in String format.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface edu.fiu.jtlex.data.INode

    equals
  • 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 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 java.lang.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:
      Modality (natural language)
    • 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 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:
      getCardinality in interface IInstance
      Returns:
      the cardinality, only present if there is a signal that provides its value.
      See Also:
      IInstance
    • 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 java.lang.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.
      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.
      Specified by:
      addInLink in interface IInstance
      Specified by:
      addInLink in interface INode
      Parameters:
      link - link to add
    • getOutLinks

      public java.util.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 java.util.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.
      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.
      Specified by:
      removeInLink in interface IInstance
      Specified by:
      removeInLink in interface INode
      Parameters:
      link - link to remove
    • toString

      public java.lang.String toString()
      Returns the info of the Instance in String format.
      Overrides:
      toString in class java.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.
      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.