All Downloads are FREE. Search and download functionalities are using the official Maven repository.

java-fsm.code.net.openai.util.fsm.UnhandledConditionException Maven / Gradle / Ivy

Go to download

OpenAI FSM is used by Apache cTAKES. It was originally developed out of sourceforge openAI group

The newest version!
/*****************************************************************************
 * net.openai.fsm.UnhandledConditionException
 *****************************************************************************
 * @author  JC on E
 * @date    9/18/2000
 * 2001 OpenAI Labs
 *****************************************************************************/

package net.openai.util.fsm;


/**
 * An Exception for when a Condition is not satisfied
 * by the input into the Machine.  In terms of natural languages,
 * this is thrown when a sentence is invalid for the verifying machine.
 */
public final class UnhandledConditionException extends Exception {
    //implements Serializable {

    /** A handle to the State that failed to have a matching
	Condition. */
    private State sourceState = null;

    /** A handle to the object that failed to match any of the
	Conditions. */
    private Object sourceCondition = null;

    /**
     * Constructs a new UnhandledConditionException
     *
     * @param state     The State that failed to have a matching
     *                  Condition.
     * @param condition The input object that failed to match any of the
     *                  Conditions.
     */
    public UnhandledConditionException(State state, Object condition) {
	this.sourceState = state;
	this.sourceCondition = condition;
    }

    /**
     * Returns a handle to the source State.
     *
     * @return The State that failed to have a matching
     *         Condition.
     */
    public final State getState() {
	return sourceState;
    }

    /**
     * Returns a handle to the source condition object.
     *
     * @return The object that failed to match any of the
     *         Conditions.
     */
    public final Object getCondition() {
	return sourceCondition;
    }

    /**
     * Returns a String represention of this object.
     *
     * @return The String representation of this object.
     */
    public final String toString() {
	return "State (" + sourceState + ") failed to handle Condition (" +
	    sourceCondition + ")";
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy