diff --git a/src/java/org/apache/commons/graph/statemachine/State.java b/src/java/org/apache/commons/graph/statemachine/State.java deleted file mode 100644 index cd39294..0000000 --- a/src/java/org/apache/commons/graph/statemachine/State.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.apache.commons.graph.statemachine; - -import org.apache.commons.graph.*; - -/** - * Description of the Class - */ -public class State - implements Vertex, Named -{ - private String name; - private StateMachine subMachine = null; - - /** - * Constructor for the State object - * - * @param name - */ - public State(String name) - { - this.name = name; - } - - /** - * Gets the name attribute of the State object - */ - public String getName() - { - return name; - } - - /** - * Sets the submachine attribute of the State object - */ - public void setSubmachine(StateMachine subMachine) - { - this.subMachine = subMachine; - } - - /** - * Gets the submachine attribute of the State object - */ - public StateMachine getSubmachine() - { - return this.subMachine; - } - -} diff --git a/src/java/org/apache/commons/graph/statemachine/StateMachine.java b/src/java/org/apache/commons/graph/statemachine/StateMachine.java deleted file mode 100644 index 8abc0e6..0000000 --- a/src/java/org/apache/commons/graph/statemachine/StateMachine.java +++ /dev/null @@ -1,131 +0,0 @@ -package org.apache.commons.graph.statemachine; - -import java.util.Map; -import java.util.Set; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; - -import org.apache.commons.graph.*; -import org.apache.commons.graph.impl.*; -import org.apache.commons.graph.exception.*; -import org.apache.commons.graph.statemachine.exception.*; - -/** - * Description of the Class - */ -public class StateMachine - extends DirectedGraphImpl -{ - private Map states = new HashMap();// NAME X STATE - private Map transes = new HashMap();// NAME X TRANSITION - private Set finalStates = new HashSet(); - private State startState = null; - - private String name; - - /** - * Constructor for the StateMachine object - * - * @param name - */ - public StateMachine(String name) - { - this.name = name; - } - - /** - * Gets the name attribute of the StateMachine object - */ - public String getName() - { - return name; - } - - /** - * Adds a feature to the State attribute of the StateMachine object - */ - public void addState(State state) - throws GraphException - { - states.put(state.getName(), state); - addVertex(state); - } - - /** - * Adds a feature to the State attribute of the StateMachine object - */ - public void addState(String name) - throws GraphException - { - State newState = new State(name); - addState(new State(name)); - } - - /** - * Sets the startState attribute of the StateMachine object - */ - public void setStartState(State state) - { - startState = state; - } - - /** - * Sets the finalState attribute of the StateMachine object - */ - public void setFinalState(State state) - { - finalStates.add(state); - } - - /** - * Adds a feature to the Transition attribute of the StateMachine object - */ - public void addTransition(String name, - String source, - String target) - throws GraphException - { - addTransition(name, - getState(source), - getState(target)); - } - - /** - * Adds a feature to the Transition attribute of the StateMachine object - */ - public void addTransition(String name, - State source, - State target) - throws GraphException - { - Transition trans = new Transition(name, source, target); - addTransition(trans); - } - - /** - * Adds a feature to the Transition attribute of the StateMachine object - */ - public void addTransition(Transition trans) - throws GraphException - { - transes.put(trans.getName(), trans); - addEdge(trans, trans.getSource(), trans.getTarget()); - } - - /** - * Gets the state attribute of the StateMachine object - */ - public State getState(String name) - { - return (State) states.get(name); - } - - /** - * Gets the transition attribute of the StateMachine object - */ - public Transition getTransition(String name) - { - return (Transition) transes.get(name); - } -} diff --git a/src/java/org/apache/commons/graph/statemachine/Transition.java b/src/java/org/apache/commons/graph/statemachine/Transition.java deleted file mode 100644 index 49aeb10..0000000 --- a/src/java/org/apache/commons/graph/statemachine/Transition.java +++ /dev/null @@ -1,111 +0,0 @@ -package org.apache.commons.graph.statemachine; - -import org.apache.commons.graph.*; - -/** - * Description of the Class - */ -public class Transition - implements Edge, Named -{ - private String name; - private State source; - private State target; - - private String action = null; - private String guard = null; - private String output = null; - - /** - * Description of the Field - */ - public final static String EPSILON = "\u03B5"; - - /** - * Constructor for the Transition object - * - * @param name - * @param source - * @param target - */ - public Transition(String name, - State source, - State target) - { - this.name = name; - this.source = source; - this.target = target; - } - - /** - * Gets the name attribute of the Transition object - */ - public String getName() - { - return name; - } - - /** - * Gets the source attribute of the Transition object - */ - public State getSource() - { - return source; - } - - /** - * Gets the target attribute of the Transition object - */ - public State getTarget() - { - return target; - } - - /** - * Sets the action attribute of the Transition object - */ - public void setAction() - { - this.action = action; - } - - /** - * Gets the action attribute of the Transition object - */ - public String getAction() - { - return action; - } - - /** - * Sets the guard attribute of the Transition object - */ - public void setGuard(String guard) - { - this.guard = guard; - } - - /** - * Gets the guard attribute of the Transition object - */ - public String getGuard() - { - return guard; - } - - /** - * Gets the output attribute of the Transition object - */ - public String getOutput() - { - return output; - } - - /** - * Sets the output attribute of the Transition object - */ - public void setOutput(String output) - { - this.output = output; - } -} diff --git a/src/java/org/apache/commons/graph/statemachine/exception/StateMachineException.java b/src/java/org/apache/commons/graph/statemachine/exception/StateMachineException.java deleted file mode 100644 index c1999ab..0000000 --- a/src/java/org/apache/commons/graph/statemachine/exception/StateMachineException.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.apache.commons.graph.statemachine.exception; - -import org.apache.commons.graph.exception.*; - -/** - * Description of the Class - */ -public class StateMachineException - extends GraphException -{ - /** - * Constructor for the StateMachineException object - */ - public StateMachineException() - { - super(); - } - - /** - * Constructor for the StateMachineException object - * - * @param msg - */ - public StateMachineException(String msg) - { - super(msg); - } - - /** - * Constructor for the StateMachineException object - * - * @param t - */ - public StateMachineException(Throwable t) - { - super(t); - } -}