Package org.jacop.util.fsm
Class FSMState
- java.lang.Object
-
- org.jacop.util.fsm.FSMState
-
public class FSMState extends java.lang.Object- Version:
- 4.8
-
-
Field Summary
Fields Modifier and Type Field Description intidId of the state.java.util.Set<FSMTransition>transitionsIt specifies the list of transitions outgoing from this state.
-
Constructor Summary
Constructors Constructor Description FSMState()It creates a state with id equl to the number of instances FSMState created.FSMState(java.util.HashSet<FSMTransition> transitions, int id)It constructs a FSM state.FSMState(FSMState a)It creates a state with an id as the id specified by a supplied state.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTransition(FSMTransition transition)It adds transition to the list of transitions from this state.FSMStatedeepClone(java.util.Set<FSMState> states)Performing deep clone unless this state has already a state with the same id in the array of states.booleanequals(java.lang.Object o)inthashCode()java.lang.StringtoString()
-
-
-
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.Set<FSMTransition> transitions
It specifies the list of transitions outgoing from this state.
-
-
Constructor Detail
-
FSMState
public FSMState(java.util.HashSet<FSMTransition> transitions, int id)
It constructs a FSM state.- Parameters:
transitions- it specifies transitionid- state 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.Set<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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-