/*
 *
 * Copyright (c) 2007
 * Adrian Michel
 * http://www.tradery.com
 *
 * Permission to use, copy, modify, distribute and sell this software
 * and its documentation for any purpose is hereby granted without fee,
 * provided that the above copyright notice appear in all copies and
 * that both that copyright notice and this permission notice appear
 * in supporting documentation.  Adrian Michel makes no
 * representations about the suitability of this software for any
 * purpose.  It is provided "as is" without express or implied warranty.
*/

package com.tradery.contentmodel;

import com.tradery.contract.Contract;
import java.util.Enumeration;

/**
 * Abstract base class for all the state classes
 */
public interface AbstractState
{
  /**
   * gets all valid transitions from the current state
   *
   * @return An enumeration of the valid transitions
   */
  public Enumeration getValidTransitions();

  /**
   * this generates a transition from the current state
   * to the next state, on the input symbol "word"
   *
   * @param word
   * @return
   */
  public boolean doTransition(String word);

  /**
   * This checks if the symbol "word" can generate a valid transition, without
   * doing the actual transition.
   *
   * @param word   The symbol to be checked
   * @return true if the symbol would generate a valid transition, false otherwise
   */
  public boolean isValidTransition( String word );

  /**
   * this indicates if the state machine can terminate
   * this is more than showing that the current state is
   * a final state, for state machines like the one that
   * checks ranges
   *
   * @return If the current state is a final state, return true, else return false
   */
  public boolean canTerminate();
}