package edu.fiu.jtlex.data;

/**
 * Default implementation of {@code ISignal}.
 * 
 * @author arada002
 *
 */
public class Signal implements ISignal {

	private final int signalID;
	private final String signalString;		// I don't know if we need this
	
	
	
	/**
	 * Creates a new Signal object.
	 * @param signalID						a unique ID number 
	 * @param signalString					temporal preposition, conjunction or modifier phrase
	 * @throws IllegalArgumentException 	if signalID is less than 1
	 * 										if signalString is empty or all whitespace
	 * @throws NullPointerException 		if signalString is null
	 */
	public Signal(int signalID, String signalString) {
		if (signalID < 1) {
			throw new IllegalArgumentException("Signal ID may not be less than 1");
		}
		if (signalString == null) {
			throw new NullPointerException("Signal string can not be null");
		}
		signalString = signalString.trim();
		if (signalString.length() == 0) {
			throw new IllegalArgumentException("Signal string can not be empty string or "
					+ "all whitespace");
		}
		this.signalID = signalID;
		this.signalString = signalString;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see edu.fiu.jtlex.data.ISignal#getID()
	 */
	public int getID() {
		return signalID;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see edu.fiu.jtlex.data.ISignal#getIdStr()
	 */
	public String getIdStr() {
		return "sid"+signalID;
	}
	
	/*
	 * (non-Javadoc)
	 * 
	 * @see edu.fiu.jtlex.data.ISignal#getSignalString()
	 */
	public String getSignalString() {
		return signalString;
	}

}
