|
||||||||||
| 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>
N - the node type.E - the edge type.public abstract class AbstractGraph<N,E>
Abstract superclass for all graphs, implementing base functionality common to all graphs.
| Constructor Summary | |
|---|---|
AbstractGraph()
|
|
| Method Summary | |
|---|---|
boolean |
addAllEdges(Collection<E> edges)
Adds all of the edges in the specified collection to this graph if they are not already present (optional operation). |
boolean |
addAllNodes(Collection<N> nodes)
Adds all of the nodes in the specified collection to this graph if they are not already present (optional operation). |
void |
clear()
Removes all nodes and all edges from this graph (optional operation). |
boolean |
containsAllEdges(Collection<E> edges)
Returns true if this graph contains all of the edges of the specified collection. |
boolean |
containsAllNodes(Collection<N> nodes)
Returns true if this graph contains all of the nodes of the specified collection. |
boolean |
containsEdge(N source,
N target)
Returns true if this graph contains the specified edge e=(source,target). |
Set<E> |
edges(GraphElementFilter<? super E> filter)
Returns an unmodifiable Set view of the edges contained in this graph that satisfy the specified filter. |
int |
edgeSize()
Returns the number of edges in this graph, i.e. the cardinality of the set of edges. |
boolean |
isEmpty()
Returns true if this graph contains no elements. |
Iterator<N> |
iterator()
|
Set<N> |
nodes(GraphElementFilter<? super N> filter)
Returns an unmodifiable Set view of the nodes contained in this graph that satisfy the specified filter. |
int |
nodeSize()
Returns the number of nodes in this graph, i.e. the cardinality of the set of nodes. |
boolean |
removeAllEdges(Collection<E> edges)
Removes from this graph all of its edges that are contained in the specified collection (optional operation). |
boolean |
removeAllNodes(Collection<N> nodes)
Removes from this graph all of its nodes that are contained in the specified collection (optional operation). |
boolean |
removeEdge(N source,
N target)
Removes the edge e=(source,target) connecting the specified source and target node from this graph if it is present (optional operation). |
boolean |
retainAllEdges(Collection<E> edges)
Retains only the edges in this graph that are contained in the specified collection (optional operation). |
boolean |
retainAllNodes(Collection<N> nodes)
Retains only the nodes in this graph that are contained in the specified collection (optional operation). |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.kuka.graph.Graph |
|---|
addEdge, addNode, containsEdge, containsNode, createEdge, createNode, edges, getEdge, incomingEdges, neighbors, nodes, outgoingEdges, removeEdge, removeNode |
| Constructor Detail |
|---|
public AbstractGraph()
| Method Detail |
|---|
public Iterator<N> iterator()
iterator in interface Iterable<N>public int nodeSize()
Graph
nodeSize in interface Graph<N,E>public int edgeSize()
Graph
edgeSize in interface Graph<N,E>public boolean isEmpty()
Graph
isEmpty in interface Graph<N,E>
public boolean containsEdge(N source,
N target)
Graph
containsEdge in interface Graph<N,E>source - the source node of the edge whose presence in this graph is to be testedtarget - the target node of the edge whose presence in this graph is to be tested
public final boolean containsAllNodes(Collection<N> nodes)
Graph
containsAllNodes in interface Graph<N,E>nodes - collection of nodes to be checked for containment in this graph
Graph.containsNode(Object)public final boolean containsAllEdges(Collection<E> edges)
Graph
containsAllEdges in interface Graph<N,E>edges - collection of edges to be checked for containment in this graph
Graph.containsEdge(Object)public final Set<N> nodes(GraphElementFilter<? super N> filter)
GraphSet view of the nodes contained in this graph that satisfy the specified filter.
The behavior of this method is the same as that of the Graph.nodes() method, except that the
nodes in the returned set must satisfy the filter and the set is not backed by the graph, i.e. changes to the
graph are not reflected in the set. If the given filter is null then all nodes are
accepted. Otherwise, a node satisfies the filter if and only if the value true results when the
GraphElementFilter.accept(E) method of the filter is invoked on the node.
nodes in interface Graph<N,E>filter - a node filter
public final Set<E> edges(GraphElementFilter<? super E> filter)
GraphSet view of the edges contained in this graph that satisfy the specified filter.
The behavior of this method is the same as that of the Graph.edges() method, except that the
edges in the returned set must satisfy the filter and the set is not backed by the graph, i.e. changes to the
graph are not reflected in the set. If the given filter is null then all edges are
accepted. Otherwise, an edge satisfies the filter if and only if the value true results when the
GraphElementFilter.accept(E) method of the filter is invoked on the edge.
edges in interface Graph<N,E>filter - an edge filter
public final boolean addAllNodes(Collection<N> nodes)
GraphIf the specified collection is a set, the addAllNodes operation effectively modifies the set of nodes so that its value is the union of the two sets. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress.
addAllNodes in interface Graph<N,E>nodes - collection containing nodes to be added to this graph
Graph.addNode(Object)public final boolean addAllEdges(Collection<E> edges)
GraphIf the specified collection is a set, the addAllEdges operation effectively modifies the set of edges so that its value is the union of the two sets. The behavior of this operation is undefined if the specified collection is modified while the operation is in progress.
addAllEdges in interface Graph<N,E>edges - collection containing edges to be added to this graph
Graph.addEdge(Object)
public final boolean removeEdge(N source,
N target)
GraphMore formally, removes an edge e* such that e.equals(e*), where e=(source,target), 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>source - the source node of the edge that is to be removedtarget - the target node of the edge that is to be removed
public final boolean removeAllNodes(Collection<N> nodes)
GraphIf the specified collection is a set, this operation effectively modifies the set of nodes so that its value is the asymmetric set difference of the two sets.
removeAllNodes in interface Graph<N,E>nodes - collection containing nodes to be removed from this graph
Graph.removeNode(Object)public final boolean removeAllEdges(Collection<E> edges)
GraphIf the specified collection is a set, this operation effectively modifies the set of edges so that its value is the asymmetric set difference of the two sets.
removeAllEdges in interface Graph<N,E>edges - collection containing edges to be removed from this graph
Graph.removeEdge(Object)public final boolean retainAllNodes(Collection<N> nodes)
GraphIn other words, removes from this graph all of its nodes that are not contained in the specified collection. If the specified collection is a set, this operation effectively modifies the set of nodes so that its value is the intersection of the two sets.
retainAllNodes in interface Graph<N,E>nodes - collection containing nodes to be retained in this graph
Graph.removeNode(Object),
Graph.removeAllNodes(Collection)public final boolean retainAllEdges(Collection<E> edges)
GraphIn other words, removes from this graph all of its edges that are not contained in the specified collection. If the specified collection is a set, this operation effectively modifies the set of edges so that its value is the intersection of the two sets.
retainAllEdges in interface Graph<N,E>edges - collection containing edges to be retained in this graph
Graph.removeEdge(Object),
Graph.removeAllEdges(Collection)public final void clear()
Graph
clear in interface Graph<N,E>public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||