N - the type of NodeM - the type of MessageT - the type of Transitionpublic interface TransitionIndex<N extends Node,M extends Message,T extends Transition<N,M>>
| Modifier and Type | Method and Description |
|---|---|
void |
add(T transition)
Adds a new transition to the index
|
void |
addAll(@NonNull Collection<T> transitions)
Adds all supplied transitions to the index.
|
void |
clear()
Removes all nodes and transitions
|
boolean |
contains(N node)
Checks the presence of the given node in
the index.
|
boolean |
contains(T transition)
Checks the presence of the given transition in
the index.
|
Optional<N> |
find(String name)
Search the given node in the transition index
by its name.
|
Collection<T> |
getAllTransitions()
Retrieve all transitions stored in the index.
|
Optional<N> |
getFirst()
Retrieves the first node in the index
|
Optional<N> |
getNext(N source,
M m)
Retrieves the next node after applying the
message on the given source node.
|
Optional<N> |
getPrevious(N source,
M m)
Retrieves the previous node upon reception of the
message on the given source node.
|
Collection<T> |
getTransitions(N node)
Retrieves the transitions stored in the index
for the given node.
|
Collection<T> |
getTransitions(String name)
Retrieves the transitions stored in the index
for the given named node.
|
Map<N,Map<M,N>> |
getTransitionsAsMap()
Retrieves the transitions as a map
|
List<N> |
prune()
Remove orphan nodes from the index
(i.e.
|
void |
remove(N node)
Removes an existing node from the index
and all its transitions.
|
void |
remove(String node)
Removes an existing node from the index
and all its transitions by its name.
|
void |
remove(T transition)
Removes an existing transition from the index
|
void |
removeAllTransitions()
Removes all transitions from the map
|
int |
size()
Retrieves the number of elements in the index
|
void add(T transition)
transition - the transition to addvoid addAll(@NonNull
@NonNull Collection<T> transitions)
transitions - the transitions to addvoid remove(T transition)
transition - the transition to removevoid remove(N node)
node - the node to removevoid remove(String node)
node - the node to removevoid removeAllTransitions()
void clear()
Optional<N> getNext(N source, M m)
source - the origin nodem - the messageOptional<N> getPrevious(N source, M m)
source - the origin nodem - the messageOptional<N> find(String name)
name - the node's name to searchboolean contains(N node)
node - the node to findboolean contains(T transition)
transition - the transition to findOptional<N> getFirst()
int size()
List<N> prune()
Collection<T> getTransitions(N node)
node - the nodeCollection<T> getTransitions(String name)
name - the node's nameCollection<T> getAllTransitions()
Copyright © 2019 state-machine. All rights reserved.