
Plexus v0.13.1  
PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object com.phoenixst.plexus.util.UnmodifiableGraph
public class UnmodifiableGraph
An unmodifiable view of a Graph
. This
Graph
will be serializable if the delegate
Graph
is serializable. Note that the Graph.Edge
objects are not wrapped, and
therefore are modifiable.
Nested Class Summary 

Nested classes/interfaces inherited from interface com.phoenixst.plexus.Graph 

Graph.Edge 
Constructor Summary  

UnmodifiableGraph(Graph delegate)
Creates an unmodifiable view of the specified Graph . 
Method Summary  

Graph.Edge 
addEdge(Object object,
Object tail,
Object head,
boolean isDirected)
Throws an UnsupportedOperationException . 
void 
addGraphListener(GraphListener listener)
Adds the specified GraphListener which will be
notified whenever this ObservableGraph's
structure changes. 
boolean 
addNode(Object node)
Throws an UnsupportedOperationException . 
Collection 
adjacentNodes(Object node,
org.apache.commons.collections.Predicate traverserPredicate)
Returns the nodes adjacent to the specified node
for which the specified Predicate is satisfied. 
boolean 
containsEdge(Graph.Edge edge)
Returns true if this Graph contains
the specified Graph.Edge . 
boolean 
containsNode(Object node)
Returns true if this Graph contains
the specified node. 
int 
degree(Object node)
Returns the degree of node , defined as the number
of edges incident on node , with selfloops
counted twice. 
int 
degree(Object node,
org.apache.commons.collections.Predicate traverserPredicate)
Returns the degree of node for which the
specified Predicate is satisfied, defined as the
number of edges incident on node that pass the
predicate, with selfloops counted only once. 
Collection 
edges(org.apache.commons.collections.Predicate edgePredicate)
Returns the Graph.Edges from this
Graph that satisfy the specified
predicate . 
Object 
getAdjacentNode(Object node,
org.apache.commons.collections.Predicate traverserPredicate)
Returns a node adjacent to the specified node for
which the specified Predicate is satisfied. 
Graph.Edge 
getEdge(org.apache.commons.collections.Predicate edgePredicate)
Returns a Graph.Edge from this Graph
that satisfies the specified predicate , or
null if no such Graph.Edge exists. 
Graph.Edge 
getIncidentEdge(Object node,
org.apache.commons.collections.Predicate traverserPredicate)
Returns a Graph.Edge incident on the specified
node for which the specified
Predicate is satisfied. 
Object 
getNode(org.apache.commons.collections.Predicate nodePredicate)
Returns a node from this Graph that satisfies the
specified predicate , or null if no
such node exists. 
Collection 
incidentEdges(Object node,
org.apache.commons.collections.Predicate traverserPredicate)
Returns the Graph.Edges incident on the specified
node for which the specified
Predicate is satisfied. 
Collection 
nodes(org.apache.commons.collections.Predicate nodePredicate)
Returns the nodes from this Graph that satisfy
the specified predicate . 
boolean 
removeEdge(Graph.Edge edge)
Throws an UnsupportedOperationException . 
void 
removeGraphListener(GraphListener listener)
Removes a previously added GraphListener . 
boolean 
removeNode(Object node)
Throws an UnsupportedOperationException . 
String 
toString()

Traverser 
traverser(Object node,
org.apache.commons.collections.Predicate traverserPredicate)
Returns a Traverser from node to all
adjacent nodes for which the specified Predicate
is satisfied. 
Methods inherited from class java.lang.Object 

clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait 
Constructor Detail 

public UnmodifiableGraph(Graph delegate)
Graph
. This Graph
will be
serializable if the specified Graph
is
serializable.
delegate
 the Graph
for which an unmodifiable
view is to be created.Method Detail 

public boolean addNode(Object node)
UnsupportedOperationException
.
addNode
in interface Graph
node
 the node to be added to this Graph
.
true
if this Graph
changed
as a result of the call, false
if this
Graph
already contains the specified node.public boolean removeNode(Object node)
UnsupportedOperationException
.
removeNode
in interface Graph
node
 the node to be removed from this
Graph
.
true
if this Graph
contained
node
.public Graph.Edge addEdge(Object object, Object tail, Object head, boolean isDirected)
UnsupportedOperationException
.
addEdge
in interface Graph
object
 the userdefined object to be contained in the
new edge.tail
 the first endpoint of the new edge.head
 the second endpoint of the new edge.isDirected
 whether the new edge is directed.
Graph.Edge
if this
Graph
changed as a result of the call,
null
if this Graph
does not allow
duplicate edges and already contains the specified edge.public boolean removeEdge(Graph.Edge edge)
UnsupportedOperationException
.
removeEdge
in interface Graph
edge
 the Graph.Edge
to be removed from
this Graph
.
true
if this Graph
contained
the specified Graph.Edge
.public Collection nodes(org.apache.commons.collections.Predicate nodePredicate)
Graph
Graph
that satisfy
the specified predicate
.
nodes
in interface Graph
nodePredicate
 the predicate which the returned nodes
must satisfy.
Graph
that satisfy
the specified predicate
.public Collection edges(org.apache.commons.collections.Predicate edgePredicate)
Graph
Graph.Edges
from this
Graph
that satisfy the specified
predicate
.
edges
in interface Graph
edgePredicate
 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)
Graph
node
for which the specified Predicate
is satisfied.
The argument to the Predicate.evaluate()
method
is expected to be an OrderedPair
. The first element of
the OrderedPair
is the specified
node
, the second is the Graph.Edge
.
It should be noted that removing a node from the returned
Collection
merely removes one instance of it
being adjacent to the specified node
. In other
words, a connecting Graph.Edge
is removed.
adjacentNodes
in interface Graph
node
 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)
Graph
Graph.Edges
incident on the specified
node
for which the specified
Predicate
is satisfied. The argument to the
Predicate.evaluate()
method is expected to be an
OrderedPair
. The first
element of the OrderedPair
is the specified
node
, the second is the Graph.Edge
.
incidentEdges
in interface Graph
node
 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 Traverser traverser(Object node, org.apache.commons.collections.Predicate traverserPredicate)
Graph
Traverser
from node
to all
adjacent nodes for which the specified Predicate
is satisfied. The argument to the
Predicate.evaluate()
method is expected to be an
OrderedPair
. The first
element of the OrderedPair
is the specified
node
, the second is the Graph.Edge
.
The nodes returned by Iterator.next()
are not
necessarily distinct. Selfloops are only traversed once.
There are no guarantees concerning the order in which the
nodes are returned (unless this Graph
is an
instance of some class that provides a guarantee).
traverser
in interface Graph
node
 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.public boolean containsNode(Object node)
Graph
true
if this Graph
contains
the specified node.
containsNode
in interface Graph
node
 the node whose presence in this Graph
is to be tested.
true
if this Graph
contains
the specified node.public boolean containsEdge(Graph.Edge edge)
Graph
true
if this Graph
contains
the specified Graph.Edge
.
containsEdge
in interface Graph
edge
 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)
Graph
node
, defined as the number
of edges incident on node
, with selfloops
counted twice. If this node has more than
Integer.MAX_VALUE
incident edges, returns
Integer.MAX_VALUE
.
degree
in interface Graph
node
 return the degree of this node.
node
.public int degree(Object node, org.apache.commons.collections.Predicate traverserPredicate)
Graph
node
for which the
specified Predicate
is satisfied, defined as the
number of edges incident on node
that pass the
predicate, with selfloops counted only once. The argument to
the Predicate.evaluate()
method is expected to be
an OrderedPair
. The first
element of the OrderedPair
is the specified
node
, the second is the Graph.Edge
.
If this node has more than Integer.MAX_VALUE
such
edges, returns Integer.MAX_VALUE
.
degree
in interface Graph
node
 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 Object getNode(org.apache.commons.collections.Predicate nodePredicate)
Graph
Graph
that satisfies the
specified predicate
, or null
if no
such node exists.
getNode
in interface Graph
nodePredicate
 the predicate which the returned node
must satisfy.
Graph
that satisfies the
specified predicate
, or null
if no
such node exists.public Graph.Edge getEdge(org.apache.commons.collections.Predicate edgePredicate)
Graph
Graph.Edge
from this Graph
that satisfies the specified predicate
, or
null
if no such Graph.Edge
exists.
getEdge
in interface Graph
edgePredicate
 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)
Graph
node
for
which the specified Predicate
is satisfied. The
argument to the Predicate.evaluate()
method is
expected to be an OrderedPair
. The first element of
the OrderedPair
is the specified
node
, the second is the Graph.Edge
.
getAdjacentNode
in interface Graph
node
 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)
Graph
Graph.Edge
incident on the specified
node
for which the specified
Predicate
is satisfied. The argument to the
Predicate.evaluate()
method is expected to be an
OrderedPair
. The first
element of the OrderedPair
is the specified
node
, the second is the Graph.Edge
.
getIncidentEdge
in interface Graph
node
 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 void addGraphListener(GraphListener listener)
ObservableGraph
GraphListener
which will be
notified whenever this ObservableGraph's
structure changes.
addGraphListener
in interface ObservableGraph
public void removeGraphListener(GraphListener listener)
ObservableGraph
GraphListener
.
removeGraphListener
in interface ObservableGraph
public String toString()
toString
in class Object

Plexus v0.13.1  
PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 