|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
S - the type of states that the graphs created by this editor containL - the type of labels that graphs created by this editor supportpublic interface StateGraphEditor<S,L>
Instances of this class may be used to define state graphs. Instances are
obtained from existing state graphs. An initial editor may be obtained from
an empty state graph which is in-turn available from the
StateFactory class.
An editor may be used after it has produced a graph without modifying the
returned graph. In this way, one editor may be used to create multiple
different graphs.
| Method Summary | |
|---|---|
boolean |
addGraph(StateGraph<S,L> graph)
Adds all of the states and transitions from an existing state graph. |
boolean |
addState(S state)
Adds a state to the current graph. |
boolean |
addStates(java.util.Set<S> states)
Adds all the states in the supplied set. |
boolean |
addTransition(S source,
L label,
S target)
Adds a transition to the current graph. |
boolean |
addTransition(StateTransition<S,L> transition)
Adds a transition to the current graph. |
boolean |
addTransitions(java.util.Set<StateTransition<S,L>> transitions)
Adds all the transitions in the supplied set. |
StateGraph<S,L> |
getGraph()
Creates a new immutable graph instance based on the state of this editor. |
boolean |
removeMultiPaths(java.util.Set<S> initial,
java.util.Set<S> terminal,
PathType type)
Removes every transition that may occur on any path between any specified initial and terminal state. |
boolean |
removePaths(S initial,
S terminal,
PathType type)
Removes every transition that may occur on any path between the specified initial and terminal states. |
boolean |
removeState(S state)
Removes a state from the current graph. |
boolean |
removeStates(java.util.Set<S> states)
Removes all the states in the supplied set. |
boolean |
removeTransition(S source,
L label,
S target)
Removes a transition from the current graph. |
boolean |
removeTransitions(java.util.Set<StateTransition<S,L>> transitions)
Removes all the transitions in the supplied set. |
boolean |
removeTransitionsLabelled(java.util.Set<L> labels)
Removes all the transitions that have a label in the supplied set. |
boolean |
removeTransitionsMatching(S source,
L label,
S target)
Removes all the transitions which match the specified parameters. |
boolean |
removeTransitionsOn(S state)
Removes all transitions which are incident on (ie. |
boolean |
retainGraph(StateGraph<S,L> graph)
Removes from the current graph all of the states and transitions that are not contained within an existing state graph. |
boolean |
retainMultiPaths(java.util.Set<S> initial,
java.util.Set<S> terminal,
PathType type)
Restricts the current graph to the smallest subgraph such that it contains every transition that occurs on any path from any specified initial state to any specified terminal state. |
boolean |
retainPaths(S initial,
S terminal,
PathType type)
Restricts the current graph to the smallest subgraph such that it contains every transition that occurs on any path from the specified initial state to the specified terminal state. |
boolean |
retainStates(java.util.Set<S> states)
Removes all the states that are not in the supplied set. |
boolean |
retainTransitions(java.util.Set<StateTransition<S,L>> transitions)
Removes all the transitions that are not in the supplied set. |
boolean |
retainTransitionsLabelled(java.util.Set<L> labels)
Removes all the transitions that do have a label in the supplied set. |
boolean |
reverse()
Reverses the directionality of every transition in the current graph. |
boolean |
substituteLabel(L from,
L to)
Replaces all occurances of one label with another. |
boolean |
substituteLabels(java.util.Set<L> from,
L to)
Replaces all the labels in a supplied set with a single label. |
boolean |
substituteState(S from,
S to)
Replaces all occurances of one state with another. |
boolean |
substituteStates(java.util.Set<S> from,
S to)
Replaces all the states in a supplied set with a single state. |
| Method Detail |
|---|
boolean addState(S state)
state - the state to be added
boolean removeState(S state)
state - the state to be removed
boolean addTransition(StateTransition<S,L> transition)
transition - the transition to add to the current graph
boolean addTransition(S source,
L label,
S target)
source - the source of the transition, not nulllabel - the label of the transition, not nulltarget - the target of the transition, not null
boolean removeTransition(S source,
L label,
S target)
source - the source of the transition, not nulllabel - the label of the transition, not nulltarget - the target of the transition, not null
boolean removeTransitionsMatching(S source,
L label,
S target)
source - the required source, or nulllabel - the required label, or nulltarget - the required target, or null
boolean removeTransitionsOn(S state)
state - the state for which the associated transitions are to be
removed, not null
boolean addStates(java.util.Set<S> states)
states - a set of states, not null
boolean removeStates(java.util.Set<S> states)
states - a set of states, not null
boolean retainStates(java.util.Set<S> states)
states - a set of states, not null
boolean addTransitions(java.util.Set<StateTransition<S,L>> transitions)
transitions - a set of transitions, not null
boolean removeTransitions(java.util.Set<StateTransition<S,L>> transitions)
transitions - a set of transitions, not null
boolean retainTransitions(java.util.Set<StateTransition<S,L>> transitions)
transitions - a set of transitions, not null
boolean removeTransitionsLabelled(java.util.Set<L> labels)
labels - the set of labels to be expunged from the current graph
boolean retainTransitionsLabelled(java.util.Set<L> labels)
labels - the set of labels to be retained
boolean addGraph(StateGraph<S,L> graph)
graph - the graph to be added to this graph
boolean retainGraph(StateGraph<S,L> graph)
graph - the graph which is to be retained by the current graph
boolean substituteState(S from,
S to)
substituteStates
does with a singleton set.
from - the state to be replacedto - the state which replaces the existing state
boolean substituteStates(java.util.Set<S> from,
S to)
from - a set of states to be replacedto - the state which replaces all states in the supplied set
boolean substituteLabel(L from,
L to)
substituteLabels
does with a singleton set.
from - the label to be replacedto - the label which replaces the existing label
boolean substituteLabels(java.util.Set<L> from,
L to)
from - a set of labels to be replacedto - the label which replaces all labels in the supplied set
boolean reverse()
boolean removePaths(S initial,
S terminal,
PathType type)
initial - the state from which each paths beginsterminal - the state at which each path endstype - a constraint on the paths
boolean removeMultiPaths(java.util.Set<S> initial,
java.util.Set<S> terminal,
PathType type)
initial - the states from which the path beginsterminal - the state at which the paths endtype - a constraint on the paths
boolean retainPaths(S initial,
S terminal,
PathType type)
initial - the state from which all paths beginterminal - the state at which all paths endtype - a constraint on the paths
boolean retainMultiPaths(java.util.Set<S> initial,
java.util.Set<S> terminal,
PathType type)
initial - the states from which any path must beginterminal - the states at which any paths must endtype - a constraint on the paths
StateGraph<S,L> getGraph()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||