public class StateMachine extends Object
| Constructor and Description |
|---|
StateMachine(InMemoryStateFlowGraph sfg,
com.google.common.collect.ImmutableList<Invariant> invariantList,
Plugins plugins,
StateComparator stateComparator,
List<StateVertex> onURLSet) |
| 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.
|
List<StateVertex> |
getOnURLSet() |
InMemoryStateFlowGraph |
getStateFlowGraph() |
StateVertex |
newStateFor(EmbeddedBrowser browser) |
void |
rewind()
reset the state machine to the initial state.
|
void |
runOnInvariantViolationPlugins(CrawlerContext context) |
void |
setCurrentState(StateVertex currentState) |
boolean |
switchToStateAndCheckIfClone(Eventable event,
StateVertex newState,
CrawlerContext context)
Adds an edge between the current and new state.
|
public StateMachine(InMemoryStateFlowGraph sfg, com.google.common.collect.ImmutableList<Invariant> invariantList, Plugins plugins, StateComparator stateComparator, List<StateVertex> onURLSet)
public StateVertex newStateFor(EmbeddedBrowser browser)
public boolean changeState(StateVertex nextState)
nextState - the next state.public StateVertex getCurrentState()
public void rewind()
public boolean switchToStateAndCheckIfClone(Eventable event, StateVertex newState, CrawlerContext context)
public void runOnInvariantViolationPlugins(CrawlerContext context)
public void setCurrentState(StateVertex currentState)
public List<StateVertex> getOnURLSet()
public InMemoryStateFlowGraph getStateFlowGraph()
Copyright © 2007–2019. All rights reserved.