Class Signal

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

public class Signal
extends java.lang.Object
implements ISignal
Default implementation of ISignal.
Author:
arada002
  • Constructor Summary

    Constructors 
    Constructor Description
    Signal​(int signalID, java.lang.String signalString)
    Creates a new Signal object.
  • Method Summary

    Modifier and Type Method Description
    Signal clone()
    Returns a deep copy clone of the Signal.
    int getID()
    Returns the ID of a Signal.
    java.lang.String getIdStr()
    Returns the String format of a Signal ID.
    java.lang.String getSignalString()
    Returns the String of a Signal.
    java.lang.String toJSON()
    Returns the String ID and String in JSON format.
    java.lang.String toString()
    Returns the Signal ID and String in String format.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Signal

      public Signal​(int signalID, java.lang.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:
      java.lang.IllegalArgumentException - if signalID is less than 1 if signalString is empty or all whitespace
      java.lang.NullPointerException - if signalString is null
  • Method Details

    • getID

      public int getID()
      Returns the ID of a Signal.
      Specified by:
      getID in interface ISignal
      Returns:
      the ID of a Signal.
    • getIdStr

      public java.lang.String getIdStr()
      Returns the String format of a Signal ID.
      Specified by:
      getIdStr in interface ISignal
      Returns:
      the ID of a Signal in String format.
    • getSignalString

      public java.lang.String getSignalString()
      Returns the String of a Signal.
      Specified by:
      getSignalString in interface ISignal
      Returns:
      the String of a Signal.
    • toString

      public java.lang.String toString()
      Returns the Signal ID and String in String format.
      Overrides:
      toString in class java.lang.Object
      Returns:
      the Signal ID and String as a String.
    • toJSON

      public java.lang.String toJSON()
      Returns the String ID and String in JSON format.
      Specified by:
      toJSON in interface ISignal
      Returns:
      JSON Formatted String of Signal ID and String.
    • clone

      public Signal clone()
      Returns a deep copy clone of the Signal.
      Specified by:
      clone in interface ISignal
      Returns:
      copy of Signal.