Class TimeMLSignal

java.lang.Object
edu.fiu.jtlex.timeml.data.TimeMLSignal
All Implemented Interfaces:
ITimeMLSignal

public class TimeMLSignal extends Object implements ITimeMLSignal
Default implementation of ISignal.
Since:
jTLEX 1.0
Author:
arada002
  • Constructor Details

    • TimeMLSignal

      public TimeMLSignal(int signalID, String signalString)
      Creates a new Signal object.
      Parameters:
      signalID - a unique ID number, must be an integer or will be undefined
      signalString - temporal preposition, conjunction or modifier phrase
      Throws:
      IllegalArgumentException - if signalID is less than 1 if signalString is empty or all whitespace
      NullPointerException - if signalString is null
  • Method Details

    • getID

      public int getID()
      Returns the ID of a Signal. Will never return null due to it being required in constructor.
      Specified by:
      getID in interface ITimeMLSignal
      Returns:
      the ID of a Signal.
      Since:
      jTLEX 1.0
    • getIdStr

      public String getIdStr()
      Returns the String format of a Signal ID. Will never return null since it is required in constructor.
      Specified by:
      getIdStr in interface ITimeMLSignal
      Returns:
      the ID of a Signal in String format.
      Since:
      jTLEX 1.0
    • getSignalString

      public String getSignalString()
      Returns the String of a Signal. Will never return null because constructor requires a valid string.
      Specified by:
      getSignalString in interface ITimeMLSignal
      Returns:
      the String of a Signal.
      Since:
      jTLEX 1.0
    • toString

      public String toString()
      Returns the Signal ID and String in String format. Will never return null due to constructor requiring them.
      Specified by:
      toString in interface ITimeMLSignal
      Overrides:
      toString in class Object
      Returns:
      the Signal ID and String as a String.
      Since:
      jTLEX 1.0
    • toJson

      public String toJson()
      Returns the String ID and String in JSON format. Will never return null due to constructor.
      Specified by:
      toJson in interface ITimeMLSignal
      Returns:
      JSON Formatted String of Signal ID and String.
      Since:
      jTLEX 1.0
    • clone

      public TimeMLSignal clone()
      Returns a field-by-field copy clone of the Signal. Will never return null, will always return a valid clone.
      Specified by:
      clone in interface ITimeMLSignal
      Overrides:
      clone in class Object
      Returns:
      copy of Signal.
      Since:
      jTLEX 1.0
    • hashCode

      public int hashCode()
      Generates a hash code for the signal.
      Specified by:
      hashCode in interface ITimeMLSignal
      Overrides:
      hashCode in class Object
      Returns:
      The hash code.
      Since:
      jTLEX 1.0
    • equals

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