|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.tomgibara.pronto.state.impl.StateGraphEditorImpl<S,L>
public class StateGraphEditorImpl<S,L>
| Constructor Summary | |
|---|---|
StateGraphEditorImpl()
|
|
StateGraphEditorImpl(StateGraph<S,L> graph)
|
|
| 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> set)
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>> trans)
Adds all the transitions in the supplied set. |
StateGraphImpl<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> set)
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>> trans)
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> set)
Removes all the states that are not in the supplied set. |
boolean |
retainTransitions(java.util.Set<StateTransition<S,L>> trans)
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StateGraphEditorImpl()
public StateGraphEditorImpl(StateGraph<S,L> graph)
| Method Detail |
|---|
public boolean addState(S state)
StateGraphEditor
addState in interface StateGraphEditor<S,L>state - the state to be added
public boolean removeState(S state)
StateGraphEditor
removeState in interface StateGraphEditor<S,L>state - the state to be removed
public boolean addTransition(StateTransition<S,L> transition)
StateGraphEditor
addTransition in interface StateGraphEditor<S,L>transition - the transition to add to the current graph
public boolean addTransition(S source,
L label,
S target)
StateGraphEditor
addTransition in interface StateGraphEditor<S,L>source - the source of the transition, not nulllabel - the label of the transition, not nulltarget - the target of the transition, not null
public boolean removeTransition(S source,
L label,
S target)
StateGraphEditor
removeTransition in interface StateGraphEditor<S,L>source - the source of the transition, not nulllabel - the label of the transition, not nulltarget - the target of the transition, not null
public boolean removeTransitionsMatching(S source,
L label,
S target)
StateGraphEditor
removeTransitionsMatching in interface StateGraphEditor<S,L>source - the required source, or nulllabel - the required label, or nulltarget - the required target, or null
public boolean removeTransitionsOn(S state)
StateGraphEditor
removeTransitionsOn in interface StateGraphEditor<S,L>state - the state for which the associated transitions are to be
removed, not null
public boolean addStates(java.util.Set<S> set)
StateGraphEditor
addStates in interface StateGraphEditor<S,L>set - a set of states, not null
public boolean removeStates(java.util.Set<S> set)
StateGraphEditor
removeStates in interface StateGraphEditor<S,L>set - a set of states, not null
public boolean retainStates(java.util.Set<S> set)
StateGraphEditor
retainStates in interface StateGraphEditor<S,L>set - a set of states, not null
public boolean addTransitions(java.util.Set<StateTransition<S,L>> trans)
StateGraphEditor
addTransitions in interface StateGraphEditor<S,L>trans - a set of transitions, not null
public boolean removeTransitions(java.util.Set<StateTransition<S,L>> trans)
StateGraphEditor
removeTransitions in interface StateGraphEditor<S,L>trans - a set of transitions, not null
public boolean retainTransitions(java.util.Set<StateTransition<S,L>> trans)
StateGraphEditor
retainTransitions in interface StateGraphEditor<S,L>trans - a set of transitions, not null
public boolean addGraph(StateGraph<S,L> graph)
StateGraphEditor
addGraph in interface StateGraphEditor<S,L>graph - the graph to be added to this graph
public boolean retainGraph(StateGraph<S,L> graph)
StateGraphEditor
retainGraph in interface StateGraphEditor<S,L>graph - the graph which is to be retained by the current graph
public boolean removeTransitionsLabelled(java.util.Set<L> labels)
StateGraphEditor
removeTransitionsLabelled in interface StateGraphEditor<S,L>labels - the set of labels to be expunged from the current graph
public boolean retainTransitionsLabelled(java.util.Set<L> labels)
StateGraphEditor
retainTransitionsLabelled in interface StateGraphEditor<S,L>labels - the set of labels to be retained
public boolean substituteState(S from,
S to)
StateGraphEditorsubstituteStates
does with a singleton set.
substituteState in interface StateGraphEditor<S,L>from - the state to be replacedto - the state which replaces the existing state
public boolean substituteStates(java.util.Set<S> from,
S to)
StateGraphEditor
substituteStates in interface StateGraphEditor<S,L>from - a set of states to be replacedto - the state which replaces all states in the supplied set
public boolean substituteLabel(L from,
L to)
StateGraphEditorsubstituteLabels
does with a singleton set.
substituteLabel in interface StateGraphEditor<S,L>from - the label to be replacedto - the label which replaces the existing label
public boolean substituteLabels(java.util.Set<L> from,
L to)
StateGraphEditor
substituteLabels in interface StateGraphEditor<S,L>from - a set of labels to be replacedto - the label which replaces all labels in the supplied set
public boolean reverse()
StateGraphEditor
reverse in interface StateGraphEditor<S,L>
public boolean removePaths(S initial,
S terminal,
PathType type)
StateGraphEditor
removePaths in interface StateGraphEditor<S,L>initial - the state from which each paths beginsterminal - the state at which each path endstype - a constraint on the paths
public boolean removeMultiPaths(java.util.Set<S> initial,
java.util.Set<S> terminal,
PathType type)
StateGraphEditor
removeMultiPaths in interface StateGraphEditor<S,L>initial - the states from which the path beginsterminal - the state at which the paths endtype - a constraint on the paths
public boolean retainPaths(S initial,
S terminal,
PathType type)
StateGraphEditor
retainPaths in interface StateGraphEditor<S,L>initial - the state from which all paths beginterminal - the state at which all paths endtype - a constraint on the paths
public boolean retainMultiPaths(java.util.Set<S> initial,
java.util.Set<S> terminal,
PathType type)
StateGraphEditor
retainMultiPaths in interface StateGraphEditor<S,L>initial - the states from which any path must beginterminal - the states at which any paths must endtype - a constraint on the paths
public StateGraphImpl<S,L> getGraph()
StateGraphEditor
getGraph in interface StateGraphEditor<S,L>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||