com.phoenixst.plexus

Class LoggingGraph

public class LoggingGraph extends Object implements ObservableGraph

A Graph which wraps another to provide logging support.

Since: 1.0

Version: $Revision: 1.13 $

Author: Ray A. Conner

Constructor Summary
LoggingGraph(Graph delegate)
Creates a new LoggingGraph which logs to a category corresponding to this class at the DEBUG level.
LoggingGraph(Graph delegate, Logger logger)
Creates a new LoggingGraph which uses the specified log at the DEBUG level.
LoggingGraph(Graph delegate, Logger logger, Level level)
Creates a new LoggingGraph.
Method Summary
Graph.EdgeaddEdge(Object object, Object tail, Object head, boolean isDirected)
voidaddGraphListener(GraphListener listener)
Adds the specified GraphListener which will be notified whenever this ObservableGraph's structure changes.
booleanaddNode(Object node)
CollectionadjacentNodes(Object node, Predicate traverserPredicate)
booleancontainsEdge(Graph.Edge edge)
booleancontainsNode(Object node)
intdegree(Object node)
intdegree(Object node, Predicate traverserPredicate)
Collectionedges(Predicate edgePredicate)
ObjectgetAdjacentNode(Object node, Predicate traverserPredicate)
protected GraphgetDelegate()
Provides access to internal state so it can be used by extensions of this class.
Graph.EdgegetEdge(Predicate edgePredicate)
Graph.EdgegetIncidentEdge(Object node, Predicate traverserPredicate)
protected LevelgetLevel()
Provides access to internal state so it can be used by extensions of this class.
protected LoggergetLogger()
Provides access to internal state so it can be used by extensions of this class.
ObjectgetNode(Predicate nodePredicate)
CollectionincidentEdges(Object node, Predicate traverserPredicate)
Collectionnodes(Predicate nodePredicate)
booleanremoveEdge(Graph.Edge edge)
voidremoveGraphListener(GraphListener listener)
Removes a previously added GraphListener.
booleanremoveNode(Object node)
StringtoString()
Traversertraverser(Object node, Predicate traverserPredicate)

Constructor Detail

LoggingGraph

public LoggingGraph(Graph delegate)
Creates a new LoggingGraph which logs to a category corresponding to this class at the DEBUG level.

LoggingGraph

public LoggingGraph(Graph delegate, Logger logger)
Creates a new LoggingGraph which uses the specified log at the DEBUG level.

LoggingGraph

public LoggingGraph(Graph delegate, Logger logger, Level level)
Creates a new LoggingGraph.

Method Detail

addEdge

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

addGraphListener

public void addGraphListener(GraphListener listener)
Adds the specified GraphListener which will be notified whenever this ObservableGraph's structure changes. If the wrapped graph does not implement ObservableGraph, then this method with throw an UnsupportedOperationException.

addNode

public boolean addNode(Object node)

adjacentNodes

public Collection adjacentNodes(Object node, Predicate traverserPredicate)

containsEdge

public boolean containsEdge(Graph.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)

getDelegate

protected final Graph getDelegate()
Provides access to internal state so it can be used by extensions of this class.

getEdge

public Graph.Edge getEdge(Predicate edgePredicate)

getIncidentEdge

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

getLevel

protected final Level getLevel()
Provides access to internal state so it can be used by extensions of this class.

getLogger

protected final Logger getLogger()
Provides access to internal state so it can be used by extensions of this class.

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)

removeGraphListener

public void removeGraphListener(GraphListener listener)
Removes a previously added GraphListener. If the wrapped graph does not implement ObservableGraph, then this method with throw an UnsupportedOperationException.

removeNode

public boolean removeNode(Object node)

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.