Class TimeMLInstance

java.lang.Object
edu.fiu.jtlex.timeml.data.TimeMLInstance
All Implemented Interfaces:
ITimeMLInstance, ITimeMLNode

public class TimeMLInstance extends Object implements ITimeMLInstance
Default implementation of IMakeInstance.
Since:
jTLEX 1.0
Author:
arada002
  • Constructor Details

    • TimeMLInstance

      public TimeMLInstance(int eventInstanceID, ITimeMLEvent event, ITimeMLInstance.Tense tense, ITimeMLInstance.Aspect aspect, ITimeMLInstance.Pos pos, ITimeMLInstance.Polarity polarity, String modality, ITimeMLSignal 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
      Throws:
      NullPointerException - if Event, Tense, Aspect, Pos, or Polarity are null
      IllegalArgumentException - if Modality is empty or all whitespace
  • Method Details

    • getId

      public int getId()
      Returns the unique ID number eventInstanceID.
      Specified by:
      getId in interface ITimeMLInstance
      Specified by:
      getId in interface ITimeMLNode
      Returns:
      the unique ID number eventInstanceID.
      Since:
      jTLEX 1.0
    • getEvent

      public String getEvent()
      Returns the ID of the event to which the instance is related.
      Specified by:
      getEvent in interface ITimeMLInstance
      Returns:
      the ID of the event to which the instance is related.
      Since:
      jTLEX 1.0
    • getTense

      public ITimeMLInstance.Tense getTense()
      Returns the tense of the verbal phrase.
      Specified by:
      getTense in interface ITimeMLInstance
      Returns:
      the tense of the verbal phrase. May not return null.
      Since:
      jTLEX 1.0
    • getAspect

      public ITimeMLInstance.Aspect getAspect()
      Returns the aspect of the verbal phrase.
      Specified by:
      getAspect in interface ITimeMLInstance
      Returns:
      the aspect of the verbal phrase. May not return null.
      Since:
      jTLEX 1.0
    • getPos

      public ITimeMLInstance.Pos getPos()
      Returns the syntactic category of the phrase (part of speech).
      Specified by:
      getPos in interface ITimeMLInstance
      Returns:
      the syntactic category of the phrase (part of speech). May not return null.
      Since:
      jTLEX 1.0
    • 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 ITimeMLInstance
      Returns:
      the modal word that modifies the instance. May return null.
      Since:
      jTLEX 1.0
      See Also:
    • getPolarity

      public ITimeMLInstance.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 ITimeMLInstance
      Returns:
      polarity: NEG if the phrase is negated, POS if the phrase is not negated. May not return null.
      Since:
      jTLEX 1.0
    • getSignal

      public ITimeMLSignal 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 ITimeMLInstance
      Returns:
      the signal object, present if multiple event instances are created.
      Since:
      jTLEX 1.0
    • 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 ITimeMLInstance
      Returns:
      the cardinality, only present if there is a signal that provides its value.
      Since:
      jTLEX 1.0
      See Also:
    • getType

      public ITimeMLEvent.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 ITimeMLInstance
      Specified by:
      getType in interface ITimeMLNode
      Returns:
      the event class of the event instance.
      Since:
      jTLEX 1.0
    • getIdStr

      public String getIdStr()
      Grabs the eventInstanceID, adds eiid to the front for the String format and returns.
      Specified by:
      getIdStr in interface ITimeMLInstance
      Specified by:
      getIdStr in interface ITimeMLNode
      Returns:
      the eventInstanceID in string format.
      Since:
      jTLEX 1.0
    • 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.
      Since:
      jTLEX 1.0
    • toJson

      public String toJson()
      Converts the Instance and its info into JSON format.
      Specified by:
      toJson in interface ITimeMLNode
      Returns:
      the JSON format of the Instance.
      Since:
      jTLEX 1.0
    • clone

      public TimeMLInstance clone()
      Creates and returns a field-by-field copy of the Instance.
      Specified by:
      clone in interface ITimeMLNode
      Overrides:
      clone in class Object
      Returns:
      a copy of the Instance.
      Since:
      jTLEX 1.0
    • equals

      public boolean equals(Object o)
      Checks if this instance equals an object.
      Specified by:
      equals in interface ITimeMLInstance
      Specified by:
      equals in interface ITimeMLNode
      Overrides:
      equals in class Object
      Parameters:
      o - The object to compare against.
      Returns:
      True if both instances are equal, i.e. same ID and event, or else false.
      Throws:
      NullPointerException - If the object to compare against is false.
      Since:
      jTLEX 1.0