Class Signal

java.lang.Object
edu.fiu.jtlex.data.Signal
All Implemented Interfaces:
ISignal

public class Signal extends Object implements ISignal
Default implementation of ISignal.
Since:
Revision 74
Author:
arada002
  • Constructor Details

    • Signal

      public Signal(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 ISignal
      Returns:
      the ID of a Signal.
      Since:
      Revision 74
    • 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 ISignal
      Returns:
      the ID of a Signal in String format.
      Since:
      Revision 74
    • 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 ISignal
      Returns:
      the String of a Signal.
      Since:
      Revision 74
    • 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 ISignal
      Overrides:
      toString in class Object
      Returns:
      the Signal ID and String as a String.
      Since:
      Revision 384
    • 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 ISignal
      Returns:
      JSON Formatted String of Signal ID and String.
      Since:
      Revision 391
    • clone

      public Signal clone()
      Returns a deep copy clone of the Signal. Will never return null, will always return a valid clone.
      Specified by:
      clone in interface ISignal
      Returns:
      copy of Signal.
      Since:
      Revision 394