public class EmptyGraph extends AbstractIntegerNodeGraph
Graph containing a set of Integer
nodes and no edges.AbstractIntegerNodeGraph.AbstractIntegerEdgeCollection, AbstractIntegerNodeGraph.EdgeImplGraph.Edge| Constructor and Description |
|---|
EmptyGraph(int n)
Creates a new
EmptyGraph. |
| Modifier and Type | Method and Description |
|---|---|
Collection |
adjacentNodes(Object node,
org.apache.commons.collections.Predicate traverserPredicate)
Returns an empty
Collection. |
boolean |
containsEdge(Graph.Edge edge)
Returns
false. |
protected Graph.Edge |
createEdge(int tailIndex,
int headIndex)
If an edge exists between the specified indices, create and
return it.
|
protected Collection |
createEdgeCollection()
Creates the (single) collection of edges for this instance.
|
protected Traverser |
createTraverser(int nodeIndex)
Creates a traverser with no filtering; assumes that the node
index is valid.
|
int |
degree(Object node)
Returns
0. |
int |
degree(Object node,
org.apache.commons.collections.Predicate traverserPredicate)
Returns
0. |
Collection |
edges(org.apache.commons.collections.Predicate edgePredicate)
Returns an empty
Collection. |
Object |
getAdjacentNode(Object node,
org.apache.commons.collections.Predicate traverserPredicate)
Returns
null. |
Graph.Edge |
getEdge(org.apache.commons.collections.Predicate edgePredicate)
Returns
null. |
Graph.Edge |
getIncidentEdge(Object node,
org.apache.commons.collections.Predicate traverserPredicate)
Returns
null. |
Collection |
incidentEdges(Object node,
org.apache.commons.collections.Predicate traverserPredicate)
Returns an empty
Collection. |
String |
toString() |
Traverser |
traverser(Object node,
org.apache.commons.collections.Predicate traverserPredicate)
Returns an empty
Traverser. |
checkNode, containsNode, edges, getNodeIndex, getNodeSize, nodes, removeEdge, removeNode, traverseraddEdge, addNode, getNode, nodespublic boolean containsEdge(Graph.Edge edge)
false.containsEdge in interface GraphcontainsEdge in class AbstractIntegerNodeGraphedge - the Graph.Edge whose presence in this
Graph is to be tested.true if this Graph contains
the specified Graph.Edge.public int degree(Object node)
0.degree in interface Graphdegree in class AbstractGraphnode - return the degree of this node.node.public int degree(Object node, org.apache.commons.collections.Predicate traverserPredicate)
0.degree in interface Graphdegree in class AbstractGraphnode - return the degree of this node for which the
specified predicate is satisfied.traverserPredicate - the predicate which the counted
Graph.Edges must satisfy.node for which the
specified predicate is satisfied.public Collection edges(org.apache.commons.collections.Predicate edgePredicate)
Collection.edges in interface Graphedges in class AbstractGraphedgePredicate - the predicate which the returned
Graph.Edges must satisfy.Graph.Edges from this
Graph that satisfy the specified
predicate.public Collection adjacentNodes(Object node, org.apache.commons.collections.Predicate traverserPredicate)
Collection.adjacentNodes in interface GraphadjacentNodes in class AbstractGraphnode - return the nodes adjacent to this node for which
the specified predicate is satisfied.traverserPredicate - the predicate which the returned
nodes and the traversed Graph.Edges must satisfy.node
for which the specified predicate is satisfied.public Collection incidentEdges(Object node, org.apache.commons.collections.Predicate traverserPredicate)
Collection.incidentEdges in interface GraphincidentEdges in class AbstractGraphnode - return the Graph.Edges incident on
this node for which the specified predicate is satisfied.traverserPredicate - the predicate which the returned
Graph.Edges must satisfy.Graph.Edges incident on the specified
node for which the specified predicate is
satisfied.public Graph.Edge getEdge(org.apache.commons.collections.Predicate edgePredicate)
null.getEdge in interface GraphgetEdge in class AbstractGraphedgePredicate - the predicate which the returned
Graph.Edge must satisfy.Graph.Edge from this Graph
that satisfies the specified predicate, or
null if no such Graph.Edge exists.public Object getAdjacentNode(Object node, org.apache.commons.collections.Predicate traverserPredicate)
null.getAdjacentNode in interface GraphgetAdjacentNode in class AbstractGraphnode - traverse to a node adjacent to this node for which
the specified predicate is satisfied.traverserPredicate - the predicate which the returned
node and the traversed Graph.Edge must satisfy.node for
which the specified predicate is satisfied.public Graph.Edge getIncidentEdge(Object node, org.apache.commons.collections.Predicate traverserPredicate)
null.getIncidentEdge in interface GraphgetIncidentEdge in class AbstractGraphnode - traverse to a Graph.Edge incident on
this node for which the specified predicate is satisfied.traverserPredicate - the predicate which the returned
Graph.Edge must satisfy.Graph.Edge incident on the specified
node for which the specified predicate is
satisfied.public Traverser traverser(Object node, org.apache.commons.collections.Predicate traverserPredicate)
Traverser.traverser in interface Graphtraverser in class AbstractGraphnode - traverse over all nodes adjacent to this node for
which the specified predicate is satisfied.traverserPredicate - the predicate which the returned
nodes and their traversed Graph.Edges must
satisfy.Traverser from node to all
adjacent nodes for which the specified predicate is satisfied.protected Graph.Edge createEdge(int tailIndex, int headIndex)
AbstractIntegerNodeGraphnull. The indices are
assumed to represent valid nodes for this Graph.createEdge in class AbstractIntegerNodeGraphprotected Collection createEdgeCollection()
AbstractIntegerNodeGraphcreateEdgeCollection in class AbstractIntegerNodeGraphprotected Traverser createTraverser(int nodeIndex)
AbstractIntegerNodeGraphcreateTraverser in class AbstractIntegerNodeGraphSee the Plexus project home, hosted by SourceForge.
Copyright ? 1994-2006, by Phoenix Software Technologists, Inc. and others. All Rights Reserved. Use is subject to license terms.