public class StateMachine extends Object
| Constructor and Description |
|---|
StateMachine(StateFlowGraph sfg,
com.google.common.collect.ImmutableList<Invariant> invariantList,
Plugins plugins,
StateComparator stateComparator)
Create a new StateMachine.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
changeState(StateVertex nextState)
Change the currentState to the nextState if possible.
|
StateVertex |
getCurrentState()
Return the current State in this state machine.
|
StateVertex |
newStateFor(EmbeddedBrowser browser) |
void |
rewind()
reset the state machine to the initial state.
|
boolean |
swithToStateAndCheckIfClone(Eventable event,
StateVertex newState,
CrawlerContext context)
Adds an edge between the current and new state.
|
public StateMachine(StateFlowGraph sfg, com.google.common.collect.ImmutableList<Invariant> invariantList, Plugins plugins, StateComparator stateComparator)
sfg - the state flow graph that is shared.indexState - the state representing the Index vertixinvariantList - the invariants to use in the InvariantChecker.public StateVertex newStateFor(EmbeddedBrowser browser)
public boolean changeState(StateVertex nextState)
nextState - the next state.public StateVertex getCurrentState()
public void rewind()
public boolean swithToStateAndCheckIfClone(Eventable event, StateVertex newState, CrawlerContext context)
event - the event edge.newState - the new state.browser - used to feet to checkInvariantssession - the current SessionCopyright © 2007-2013. All Rights Reserved.