Package com.crawljax.core.state
Interface StateFlowGraph
-
- All Known Implementing Classes:
InMemoryStateFlowGraph
public interface StateFlowGraphA graph ofStateVertexas vertexes andEventableas edges
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanGoTo(StateVertex source, StateVertex target)Is it possible to go from s1 -> s2?com.google.common.collect.ImmutableSet<Eventable>getAllEdges()Return all the edges in the StateFlowGraph.List<List<org.jgrapht.GraphPath<StateVertex,Eventable>>>getAllPossiblePaths(StateVertex index)This method returns all possible paths from the index state using the k-shortest paths.com.google.common.collect.ImmutableSet<StateVertex>getAllStates()Return all the states in the StateFlowGraph.StateVertexgetById(int id)com.google.common.collect.ImmutableSet<Eventable>getIncomingClickable(StateVertex stateVertex)Returns a set of all edges incoming into the specified vertex.StateVertexgetInitialState()intgetMeanStateStringSize()intgetNumberOfStates()com.google.common.collect.ImmutableSet<Eventable>getOutgoingClickables(StateVertex stateVertex)Returns a set of all clickables outgoing from the specified vertex.com.google.common.collect.ImmutableSet<StateVertex>getOutgoingStates(StateVertex stateVertex)com.google.common.collect.ImmutableList<Eventable>getShortestPath(StateVertex start, StateVertex end)Convenience method to find the Dijkstra shortest path between two states on the graph.booleanhasClone(StateVertex vertex)booleanremoveEdge(Eventable event)booleanremoveState(StateVertex state)booleanrestoreEdge(Eventable event)booleanrestoreState(StateVertex state)
-
-
-
Method Detail
-
getById
StateVertex getById(int id)
- Parameters:
id- The ID of the state- Returns:
- The state if found or
null.
-
getInitialState
StateVertex getInitialState()
- Returns:
- The index state.
-
getOutgoingClickables
com.google.common.collect.ImmutableSet<Eventable> getOutgoingClickables(StateVertex stateVertex)
Returns a set of all clickables outgoing from the specified vertex.- Parameters:
stateVertex- the state vertex.- Returns:
- a set of the outgoing edges (clickables) of the stateVertex.
-
getIncomingClickable
com.google.common.collect.ImmutableSet<Eventable> getIncomingClickable(StateVertex stateVertex)
Returns a set of all edges incoming into the specified vertex.- Parameters:
stateVertex- the state vertex.- Returns:
- a set of the incoming edges (clickables) of the stateVertex.
-
canGoTo
boolean canGoTo(StateVertex source, StateVertex target)
Is it possible to go from s1 -> s2?- Parameters:
source- the source state.target- the target state.- Returns:
- true if it is possible (edge exists in graph) to go from source to target.
-
getShortestPath
com.google.common.collect.ImmutableList<Eventable> getShortestPath(StateVertex start, StateVertex end)
Convenience method to find the Dijkstra shortest path between two states on the graph.- Parameters:
start- the start state.end- the end state.- Returns:
- a list of shortest path of clickables from the state to the end
-
getAllStates
com.google.common.collect.ImmutableSet<StateVertex> getAllStates()
Return all the states in the StateFlowGraph.- Returns:
- all the states on the graph.
-
getAllEdges
com.google.common.collect.ImmutableSet<Eventable> getAllEdges()
Return all the edges in the StateFlowGraph.- Returns:
- a Set of all edges in the StateFlowGraph
-
getMeanStateStringSize
int getMeanStateStringSize()
- Returns:
- Dom string average size (byte).
-
getNumberOfStates
int getNumberOfStates()
- Returns:
- The number of states, currently in the graph.
-
getAllPossiblePaths
List<List<org.jgrapht.GraphPath<StateVertex,Eventable>>> getAllPossiblePaths(StateVertex index)
This method returns all possible paths from the index state using the k-shortest paths.- Parameters:
index- the initial state.- Returns:
- a list of GraphPath lists.
-
getOutgoingStates
com.google.common.collect.ImmutableSet<StateVertex> getOutgoingStates(StateVertex stateVertex)
- Parameters:
stateVertex- The sourceStateVertex- Returns:
- a
SetofStateVertexthat are connected to the sourceStateVertexvia one of the sources outgoing edges.
-
hasClone
boolean hasClone(StateVertex vertex)
-
removeEdge
boolean removeEdge(Eventable event)
-
restoreEdge
boolean restoreEdge(Eventable event)
-
removeState
boolean removeState(StateVertex state)
-
restoreState
boolean restoreState(StateVertex state)
-
-