JaCoP.util.fsm
Class FSMState

java.lang.Object
  extended by JaCoP.util.fsm.FSMState

public class FSMState
extends java.lang.Object

Version:
3.1
Author:
Radoslaw Szymanek

Field Summary
 int id
          Id of the state.
 java.util.HashSet<FSMTransition> transitions
          It specifies the list of transitions outgoing from this state.
static java.lang.String[] xmlAttributes
          It specifies the arguments required to be saved by an XML format as well as the constructor being called to recreate an object from an XML format.
 
Constructor Summary
FSMState()
          It creates a state with id equl to the number of instances FSMState created.
FSMState(FSMState a)
          It creates a state with an id as the id specified by a supplied state.
FSMState(java.util.HashSet<FSMTransition> transitions, int id)
          It constructs a FSM state.
 
Method Summary
 void addTransition(FSMTransition transition)
          It adds transition to the list of transitions from this state.
 FSMState deepClone(java.util.HashSet<FSMState> states)
          Performing deep clone unless this state has already a state with the same id in the array of states.
 boolean equals(java.lang.Object o)
           
 int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

id

public int id
Id of the state. There can be multiple copies of the same state with the same id.


transitions

public java.util.HashSet<FSMTransition> transitions
It specifies the list of transitions outgoing from this state.


xmlAttributes

public static java.lang.String[] xmlAttributes
It specifies the arguments required to be saved by an XML format as well as the constructor being called to recreate an object from an XML format.

Constructor Detail

FSMState

public FSMState(java.util.HashSet<FSMTransition> transitions,
                int id)
It constructs a FSM state.

Parameters:
transitions - it specifies transition
id -

FSMState

public FSMState()
It creates a state with id equl to the number of instances FSMState created.


FSMState

public FSMState(FSMState a)
It creates a state with an id as the id specified by a supplied state.

Parameters:
a - state from which id is taken while creating this state.
Method Detail

deepClone

public FSMState deepClone(java.util.HashSet<FSMState> states)
Performing deep clone unless this state has already a state with the same id in the array of states.

Parameters:
states - it contains the states which do not need to be created, only reused.
Returns:
a deep clone of the current state.

addTransition

public void addTransition(FSMTransition transition)
It adds transition to the list of transitions from this state.

Parameters:
transition - the transition being added.

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object