G - The type of the graph itself.E - The type of the edges.N - The type of the nodes.public interface IGraph<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>> extends IExtensible
IGraph is an abstract interface to a common graph. It is possible to retrieve the current nodes and edges of
this graph or a single node by its id. Furthermore it provides the possibility the retrieve the preset and postset
nodes or edges of a node.
The generic parameter define what types are used for the edges and nodes as well as the graph itself. This allows to
extend any graph in a typesafe manner at compiletime. Additionally one may add any data to the graph or one of its
components by using the IExtensible interface methods at runtime.
For examples have a look at the pn.PetriNet or ts.TransitionSystem.| Modifier and Type | Method and Description |
|---|---|
boolean |
addListener(IGraphListener<G,E,N> listener)
Add a listener to this graph.
|
java.util.Set<E> |
getEdges()
Retrieves a view of the current edge set of the graph.
|
java.lang.String |
getName()
Retrieves the name of this graph or "" if not set.
|
N |
getNode(java.lang.String id)
Retrieves the node with the given id.
|
java.util.Set<N> |
getNodes()
Retrieves a view of the current node set of the graph.
|
java.util.Set<E> |
getPostsetEdges(N n)
Retrieves a view of all edges beginning in the given node.
|
java.util.Set<E> |
getPostsetEdges(java.lang.String id)
Retrieves a view of all edges beginning in the node with the given id.
|
java.util.Set<N> |
getPostsetNodes(N node)
Retrieves a view of all nodes which have an incoming edge from the given node.
|
java.util.Set<N> |
getPostsetNodes(java.lang.String id)
Retrieves a view of all nodes which have an incoming edge from the node with the given id.
|
java.util.Set<E> |
getPresetEdges(N n)
Retrieves a view of all edges targeting the given node.
|
java.util.Set<E> |
getPresetEdges(java.lang.String id)
Retrieves a view of all edges targeting the node with the given id.
|
java.util.Set<N> |
getPresetNodes(N node)
Retrieves a view of all nodes which have an outgoing edge to the given node.
|
java.util.Set<N> |
getPresetNodes(java.lang.String id)
Retrieves a view of all nodes which have an outgoing edge to the node with the given id.
|
boolean |
removeListener(IGraphListener<G,E,N> listener)
Remove a listener from this graph.
|
getExtension, putExtension, removeExtensionboolean addListener(IGraphListener<G,E,N> listener)
listener - The listener to add.boolean removeListener(IGraphListener<G,E,N> listener)
listener - The listener to remove.java.lang.String getName()
N getNode(java.lang.String id)
id - The id of the node as a String.java.util.Set<E> getEdges()
java.util.Set<N> getNodes()
java.util.Set<N> getPresetNodes(java.lang.String id)
id - The id of a node.java.util.Set<N> getPresetNodes(N node)
node - The node.java.util.Set<N> getPostsetNodes(java.lang.String id)
id - The id of a node.java.util.Set<N> getPostsetNodes(N node)
node - The node.java.util.Set<E> getPresetEdges(java.lang.String id)
id - The id of a node.java.util.Set<E> getPresetEdges(N n)
n - The node.java.util.Set<E> getPostsetEdges(java.lang.String id)
id - The id of a node.