|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.kuka.graph.impl.AbstractGraph<N,E>
com.kuka.graph.impl.AbstractBaseGraph<N,E>
N - the node type.E - the edge type.public abstract class AbstractBaseGraph<N,E extends Edge<N>>
Abstract base implementation for directed graphs.
All queries (like neighbors, incoming and outgoing edges) are efficient, but memory consumption is quite huge.
| Constructor Summary | |
|---|---|
AbstractBaseGraph()
|
|
| Method Summary | |
|---|---|
boolean |
addEdge(E edge)
Adds the specified edge to this graph if it is not already present (optional operation). |
boolean |
addNode(N node)
Adds the specified node to this graph if it is not already present (optional operation). |
Object |
clone()
|
boolean |
containsEdge(E edge)
Returns true if this graph contains the specified edge. |
boolean |
containsNode(N node)
Returns true if this graph contains the specified node. |
Set<E> |
edges()
Returns an unmodifiable Set view of the edges contained in this graph. |
E |
getEdge(N source,
N target)
Returns the edge e=(source,target) from the specified source node to the target node, or null if this graph contains no such edge. |
Set<E> |
incomingEdges(N node)
Returns the set of all incoming edges of the specified node. |
Set<N> |
neighbors(N node)
Returns the set of all neighbors of the specified node. |
Set<N> |
nodes()
Returns an unmodifiable Set view of the nodes contained in this graph. |
Set<E> |
outgoingEdges(N node)
Returns the set of all outgoing edges of the specified node. |
boolean |
removeEdge(E edge)
Removes the specified edge e from this graph if it is present (optional operation). |
boolean |
removeNode(N node)
Removes the specified node n from this graph if it is present (optional operation). |
| Methods inherited from class com.kuka.graph.impl.AbstractGraph |
|---|
addAllEdges, addAllNodes, clear, containsAllEdges, containsAllNodes, containsEdge, edges, edgeSize, isEmpty, iterator, nodes, nodeSize, removeAllEdges, removeAllNodes, removeEdge, retainAllEdges, retainAllNodes, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.kuka.graph.Graph |
|---|
createEdge, createNode |
| Constructor Detail |
|---|
public AbstractBaseGraph()
| Method Detail |
|---|
public boolean containsNode(N node)
Graph
containsNode in interface Graph<N,E extends Edge<N>>node - node whose presence in this graph is to be tested
public boolean containsEdge(E edge)
Graph
containsEdge in interface Graph<N,E extends Edge<N>>edge - edge whose presence in this graph is to be tested
public final Set<N> nodes()
GraphSet view of the nodes contained in this graph. The set is backed by the graph, so
changes to the graph are reflected in the set. If the graph is modified while an iteration over the set is in
progress, the results of the iteration are undefined.
nodes in interface Graph<N,E extends Edge<N>>public final Set<E> edges()
GraphSet view of the edges contained in this graph. The set is backed by the graph, so
changes to the graph are reflected in the set. If the graph is modified while an iteration over the set is in
progress, the results of the iteration are undefined.
edges in interface Graph<N,E extends Edge<N>>
public E getEdge(N source,
N target)
GraphMore formally, if this graph contains an edge e* such that e.equals(e*), where e=(source,target), then this method returns e*, otherwise it returns null.
getEdge in interface Graph<N,E extends Edge<N>>source - the source node of the edge that is to be returnedtarget - the target node of the edge that is to be returned
public Set<E> outgoingEdges(N node)
GraphMore formally, this method returns all edges e in this graph such that the given node is the source node of e, i.e. e=(node,*).
outgoingEdges in interface Graph<N,E extends Edge<N>>node - the source node
public Set<E> incomingEdges(N node)
GraphMore formally, this method returns all edges e in this graph such that the given node is the target node of e, i.e. e=(*,node).
incomingEdges in interface Graph<N,E extends Edge<N>>node - the target node
public Set<N> neighbors(N node)
Graph
neighbors in interface Graph<N,E extends Edge<N>>node - the node of which all neighboring nodes are to be returned
public boolean addNode(N node)
GraphMore formally, adds the specified node n to this graph if the graph contains no element n2 such that n.equals(n2)) . If this graph already contains the element, the call leaves the graph unchanged and returns false.
addNode in interface Graph<N,E extends Edge<N>>node - node to be added to this graph
public boolean addEdge(E edge)
GraphMore formally, adds the specified edge e to this graph if the graph contains no element e2 such that e.equals(e2)) . If this graph already contains the element, the call leaves the graph unchanged and returns false.
addEdge in interface Graph<N,E extends Edge<N>>edge - edge to be added to this graph
public boolean removeNode(N node)
GraphMore formally, removes a node n* such that n.equals(n*) , if this graph contains such a node. Furthermore, all edges incident to this node are removed. Returns true if this graph contained the node (or equivalently, if this graph changed as a result of the call).
removeNode in interface Graph<N,E extends Edge<N>>node - node to be removed from this graph, if present
public boolean removeEdge(E edge)
GraphMore formally, removes an edge e* such that e.equals(e*), if this graph contains such an edge. Returns true if this graph contained the edge (or equivalently, if this graph changed as a result of the call).
removeEdge in interface Graph<N,E extends Edge<N>>edge - edge to be removed from this graph, if present
public Object clone()
throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||