G - The type of the graph of which we are a subgraph.E - The type of edges of the graph of which we are a subgraph.N - The type of nodes of the graph of which we are a subgraph.public class SubGraph<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>> extends Extensible implements IGraph<SubGraph<G,E,N>,SubEdge<G,E,N>,SubNode<G,E,N>>
SubEdge.getOriginalEdge() and SubNode.getOriginalNode() to get the edge respectively node of the original graph
that is represented by such a wrapper object.| Modifier and Type | Method and Description |
|---|---|
boolean |
addListener(IGraphListener<SubGraph<G,E,N>,SubEdge<G,E,N>,SubNode<G,E,N>> listener)
Add a listener to this graph.
|
boolean |
equals(java.lang.Object o) |
java.util.Set<SubEdge<G,E,N>> |
getEdges()
Retrieves a view of the current edge set of the graph.
|
SubGraph<G,E,N> |
getFlatSubGraphByNodeIDs(java.util.Collection<java.lang.String> ids)
Create a new sub graph for the given set of nodes.
|
SubGraph<G,E,N> |
getFlatSubGraphByNodes(java.util.Collection<SubNode<G,E,N>> nodes)
Create a new sub graph for the given set of nodes.
|
java.lang.String |
getName()
Retrieves the name of this graph or "" if not set.
|
SubNode<G,E,N> |
getNode(N node)
Get the representation of some node in this SubGraph.
|
SubNode<G,E,N> |
getNode(java.lang.String id)
Retrieves the node with the given id.
|
java.util.Set<java.lang.String> |
getNodeIDs()
Get the identifiers of the nodes that are contained in this subgraph.
|
java.util.Set<SubNode<G,E,N>> |
getNodes()
Retrieves a view of the current node set of the graph.
|
G |
getOriginalGraph()
Get the original graph of which we are a subgraph.
|
java.util.Set<SubEdge<G,E,N>> |
getPostsetEdges(java.lang.String id)
Retrieves a view of all edges beginning in the node with the given id.
|
java.util.Set<SubEdge<G,E,N>> |
getPostsetEdges(SubNode<G,E,N> node)
Retrieves a view of all edges beginning in the given node.
|
java.util.Set<SubNode<G,E,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<SubNode<G,E,N>> |
getPostsetNodes(SubNode<G,E,N> node)
Retrieves a view of all nodes which have an incoming edge from the given node.
|
java.util.Set<SubEdge<G,E,N>> |
getPresetEdges(java.lang.String id)
Retrieves a view of all edges targeting the node with the given id.
|
java.util.Set<SubEdge<G,E,N>> |
getPresetEdges(SubNode<G,E,N> node)
Retrieves a view of all edges targeting the given node.
|
java.util.Set<SubNode<G,E,N>> |
getPresetNodes(java.lang.String id)
Retrieves a view of all nodes which have an outgoing edge to the node with the given id.
|
java.util.Set<SubNode<G,E,N>> |
getPresetNodes(SubNode<G,E,N> node)
Retrieves a view of all nodes which have an outgoing edge to the given node.
|
static <G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>> |
getSubGraphByNodeIDs(G graph,
java.util.Collection<java.lang.String> ids)
Create a new sub graph for the given set of nodes.
|
static <G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>> |
getSubGraphByNodes(G graph,
java.util.Collection<N> nodes)
Create a new sub graph for the given set of nodes.
|
int |
hashCode() |
boolean |
removeListener(IGraphListener<SubGraph<G,E,N>,SubEdge<G,E,N>,SubNode<G,E,N>> listener)
Remove a listener from this graph.
|
java.lang.String |
toString() |
copyExtensions, getCopyExtensions, getExtension, getExtensions, getExtensionsWithoutProperty, getExtensionsWithProperty, getWriteToFileExtensions, hasExtension, putExtension, putExtension, removeExtensionclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetExtension, putExtension, removeExtensionpublic static <G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>> SubGraph<G,E,N> getSubGraphByNodes(G graph, java.util.Collection<N> nodes)
G - The type of the graph of which we are a subgraph.E - The type of edges of the graph of which we are a subgraph.N - The type of nodes of the graph of which we are a subgraph.graph - The graph from which to create a subgraph.nodes - The set of nodes that should be used.public static <G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>> SubGraph<G,E,N> getSubGraphByNodeIDs(G graph, java.util.Collection<java.lang.String> ids)
G - The type of the graph of which we are a subgraph.E - The type of edges of the graph of which we are a subgraph.N - The type of nodes of the graph of which we are a subgraph.graph - The graph from which to create a subgraph.ids - The set of node IDs that should be used.public SubGraph<G,E,N> getFlatSubGraphByNodes(java.util.Collection<SubNode<G,E,N>> nodes)
getSubGraphByNodes(getOriginalGraph(), nodes). However, the
nodes must belong to this subgraph and not to the original graph.nodes - The set of nodes that should be used.public SubGraph<G,E,N> getFlatSubGraphByNodeIDs(java.util.Collection<java.lang.String> ids)
getSubGraphByNodeIDs(getOriginalGraph(), ids).ids - The set of node IDs that should be used.public G getOriginalGraph()
public java.util.Set<java.lang.String> getNodeIDs()
public boolean addListener(IGraphListener<SubGraph<G,E,N>,SubEdge<G,E,N>,SubNode<G,E,N>> listener)
IGraphaddListener in interface IGraph<SubGraph<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubEdge<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubNode<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>>listener - The listener to add.public boolean removeListener(IGraphListener<SubGraph<G,E,N>,SubEdge<G,E,N>,SubNode<G,E,N>> listener)
IGraphremoveListener in interface IGraph<SubGraph<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubEdge<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubNode<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>>listener - The listener to remove.public java.lang.String getName()
IGraphgetName in interface IGraph<SubGraph<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubEdge<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubNode<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>>public SubNode<G,E,N> getNode(N node)
node - The node whose representation should be returned.public SubNode<G,E,N> getNode(java.lang.String id)
IGraphgetNode in interface IGraph<SubGraph<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubEdge<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubNode<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>>id - The id of the node as a String.public java.util.Set<SubEdge<G,E,N>> getEdges()
IGraphgetEdges in interface IGraph<SubGraph<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubEdge<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubNode<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>>public java.util.Set<SubNode<G,E,N>> getNodes()
IGraphgetNodes in interface IGraph<SubGraph<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubEdge<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubNode<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>>public java.util.Set<SubNode<G,E,N>> getPresetNodes(java.lang.String id)
IGraphgetPresetNodes in interface IGraph<SubGraph<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubEdge<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubNode<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>>id - The id of a node.public java.util.Set<SubNode<G,E,N>> getPresetNodes(SubNode<G,E,N> node)
IGraphgetPresetNodes in interface IGraph<SubGraph<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubEdge<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubNode<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>>node - The node.public java.util.Set<SubNode<G,E,N>> getPostsetNodes(java.lang.String id)
IGraphgetPostsetNodes in interface IGraph<SubGraph<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubEdge<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubNode<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>>id - The id of a node.public java.util.Set<SubNode<G,E,N>> getPostsetNodes(SubNode<G,E,N> node)
IGraphgetPostsetNodes in interface IGraph<SubGraph<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubEdge<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubNode<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>>node - The node.public java.util.Set<SubEdge<G,E,N>> getPresetEdges(java.lang.String id)
IGraphgetPresetEdges in interface IGraph<SubGraph<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubEdge<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubNode<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>>id - The id of a node.public java.util.Set<SubEdge<G,E,N>> getPresetEdges(SubNode<G,E,N> node)
IGraphgetPresetEdges in interface IGraph<SubGraph<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubEdge<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubNode<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>>node - The node.public java.util.Set<SubEdge<G,E,N>> getPostsetEdges(java.lang.String id)
IGraphgetPostsetEdges in interface IGraph<SubGraph<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubEdge<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubNode<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>>id - The id of a node.public java.util.Set<SubEdge<G,E,N>> getPostsetEdges(SubNode<G,E,N> node)
IGraphgetPostsetEdges in interface IGraph<SubGraph<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubEdge<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>,SubNode<G extends IGraph<G,E,N>,E extends IEdge<G,E,N>,N extends INode<G,E,N>>>node - The node.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object