com.phoenixst.plexus.util

Class UnmodifiableGraph

public class UnmodifiableGraph extends Object implements ObservableGraph, Serializable

An unmodifiable view of a Graph. This Graph will be serializable if the delegate Graph is serializable. Note that the Edge objects are not wrapped, and therefore are modifiable.

Since: 1.0

Version: $Revision: 1.6 $

Author: Ray A. Conner

Constructor Summary
UnmodifiableGraph(Graph delegate)
Creates an unmodifiable view of the specified Graph.
Method Summary
Graph.EdgeaddEdge(Object object, Object tail, Object head, boolean isDirected)
Throws an UnsupportedOperationException.
voidaddGraphListener(GraphListener listener)
booleanaddNode(Object node)
Throws an UnsupportedOperationException.
CollectionadjacentNodes(Object node, Predicate traverserPredicate)
booleancontainsEdge(Edge edge)
booleancontainsNode(Object node)
intdegree(Object node)
intdegree(Object node, Predicate traverserPredicate)
Collectionedges(Predicate edgePredicate)
ObjectgetAdjacentNode(Object node, Predicate traverserPredicate)
EdgegetEdge(Predicate edgePredicate)
EdgegetIncidentEdge(Object node, Predicate traverserPredicate)
ObjectgetNode(Predicate nodePredicate)
CollectionincidentEdges(Object node, Predicate traverserPredicate)
Collectionnodes(Predicate nodePredicate)
booleanremoveEdge(Graph.Edge edge)
Throws an UnsupportedOperationException.
voidremoveGraphListener(GraphListener listener)
booleanremoveNode(Object node)
Throws an UnsupportedOperationException.
StringtoString()
Traversertraverser(Object node, Predicate traverserPredicate)

Constructor Detail

UnmodifiableGraph

public UnmodifiableGraph(Graph delegate)
Creates an unmodifiable view of the specified Graph. This Graph will be serializable if the specified Graph is serializable.

Parameters: delegate the Graph for which an unmodifiable view is to be created.

Method Detail

addEdge

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

addGraphListener

public void addGraphListener(GraphListener listener)

addNode

public boolean addNode(Object node)
Throws an UnsupportedOperationException.

adjacentNodes

public Collection adjacentNodes(Object node, Predicate traverserPredicate)

containsEdge

public boolean containsEdge(Edge edge)

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)

getAdjacentNode

public Object getAdjacentNode(Object node, Predicate traverserPredicate)

getEdge

public Edge getEdge(Predicate edgePredicate)

getIncidentEdge

public Edge getIncidentEdge(Object node, Predicate traverserPredicate)

getNode

public Object getNode(Predicate nodePredicate)

incidentEdges

public Collection incidentEdges(Object node, Predicate traverserPredicate)

nodes

public Collection nodes(Predicate nodePredicate)

removeEdge

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

removeGraphListener

public void removeGraphListener(GraphListener listener)

removeNode

public boolean removeNode(Object node)
Throws an UnsupportedOperationException.

toString

public String toString()

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.