com.phoenixst.plexus.util

Class SingletonGraph

public class SingletonGraph extends Object implements Graph, Serializable

An unmodifiable Graph which contains a single node and no edges.

Since: 1.0

Version: $Revision: 1.22 $

Author: Ray A. Conner

Constructor Summary
SingletonGraph(Object node)
Creates a new SingletonGraph.
Method Summary
Graph.EdgeaddEdge(Object object, Object tail, Object head, boolean isDirected)
Throws an UnsupportedOperationException.
booleanaddNode(Object node)
Throws an UnsupportedOperationException.
CollectionadjacentNodes(Object node, Predicate traverserPredicate)
Returns an empty collection.
booleancontainsEdge(Graph.Edge edge)
Returns false.
booleancontainsNode(Object node)
intdegree(Object node)
intdegree(Object node, Predicate traverserPredicate)
Collectionedges(Predicate edgePredicate)
Returns an empty collection.
ObjectgetAdjacentNode(Object node, Predicate traverserPredicate)
Graph.EdgegetEdge(Predicate edgePredicate)
Returns null.
Graph.EdgegetIncidentEdge(Object node, Predicate traverserPredicate)
ObjectgetNode(Predicate nodePredicate)
CollectionincidentEdges(Object node, Predicate traverserPredicate)
Returns an empty collection.
Collectionnodes(Predicate nodePredicate)
booleanremoveEdge(Graph.Edge edge)
Throws an UnsupportedOperationException.
booleanremoveNode(Object node)
Throws an UnsupportedOperationException.
Traversertraverser(Object node, Predicate traverserPredicate)

Constructor Detail

SingletonGraph

public SingletonGraph(Object node)
Creates a new SingletonGraph.

Method Detail

addEdge

public Graph.Edge addEdge(Object object, Object tail, Object head, boolean isDirected)
Throws an UnsupportedOperationException.

addNode

public boolean addNode(Object node)
Throws an UnsupportedOperationException.

adjacentNodes

public Collection adjacentNodes(Object node, Predicate traverserPredicate)
Returns an empty collection.

containsEdge

public boolean containsEdge(Graph.Edge edge)
Returns false.

containsNode

public boolean containsNode(Object node)

degree

public int degree(Object node)

degree

public int degree(Object node, Predicate traverserPredicate)

edges

public Collection edges(Predicate edgePredicate)
Returns an empty collection.

getAdjacentNode

public Object getAdjacentNode(Object node, Predicate traverserPredicate)

getEdge

public Graph.Edge getEdge(Predicate edgePredicate)
Returns null.

getIncidentEdge

public Graph.Edge getIncidentEdge(Object node, Predicate traverserPredicate)

getNode

public Object getNode(Predicate nodePredicate)

incidentEdges

public Collection incidentEdges(Object node, Predicate traverserPredicate)
Returns an empty collection.

nodes

public Collection nodes(Predicate nodePredicate)

removeEdge

public boolean removeEdge(Graph.Edge edge)
Throws an UnsupportedOperationException.

removeNode

public boolean removeNode(Object node)
Throws an UnsupportedOperationException.

traverser

public Traverser traverser(Object node, Predicate traverserPredicate)
See the Plexus project home, hosted by SourceForge.
Copyright B) 1994-2006, by Phoenix Software Technologists, Inc. and others. All Rights Reserved. Use is subject to license terms.