|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.x8ing.lsm4j.state.StaticGraph
public class StaticGraph
Stores the structure of a graph. It must be possible to have several tansitions between two nodes.
We need two ways to fast get a transition.
1. get all transitions starting from a node A.
2. get all transition between node A and node B
We make a memory/speed tradeoff and use two hashmaps:
1. internode hashmap
2. outgoing node hashmap
Nested Class Summary | |
---|---|
protected static class |
StaticGraph.StateIterator
TODO implement stateiterator and transition iterator!!! |
protected static class |
StaticGraph.TransitionList
A list of transitions. |
Constructor Summary | |
---|---|
StaticGraph()
|
Method Summary | |
---|---|
void |
addTransition(StaticTransition transition)
|
void |
addValidTransition(StaticState currentState,
StaticState nextState)
|
void |
addValidTransition(StaticTransition transition)
|
int |
getStateCount()
|
protected StaticState |
getStateWithID(int stateUID)
|
java.util.List |
getTransitionListForState(int stateUID)
Get a list of transitions that leave a certain state. |
java.util.List |
getTransitionsBetweenStates(int currentStateUID,
int nextStateUID)
Get a list of transitions that are between two states. |
int |
getTransitionsCount()
|
boolean |
isValidTransition(StaticState currentState,
StaticState nextState)
|
boolean |
isValidTransition(StaticTransition transition)
|
java.lang.String |
printGraph()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public StaticGraph()
Method Detail |
---|
protected StaticState getStateWithID(int stateUID)
public void addTransition(StaticTransition transition)
public java.util.List getTransitionListForState(int stateUID)
stateUID
-
StaticTransition
public java.util.List getTransitionsBetweenStates(int currentStateUID, int nextStateUID)
currentStateUID
- nextStateUID
-
StaticTransition
public java.lang.String printGraph()
public int getTransitionsCount()
public int getStateCount()
public void addValidTransition(StaticTransition transition)
public void addValidTransition(StaticState currentState, StaticState nextState)
public boolean isValidTransition(StaticTransition transition)
public boolean isValidTransition(StaticState currentState, StaticState nextState)
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |