Plexus v0.13.1

com.phoenixst.plexus.util
Class FilteredGraphListener

java.lang.Object
  extended by com.phoenixst.plexus.util.ForwardingGraphListener
      extended by com.phoenixst.plexus.util.FilteredGraphListener
All Implemented Interfaces:
GraphListener, EventListener

public class FilteredGraphListener
extends ForwardingGraphListener

A GraphListener which filters events to be forwarded to an ObservableGraphDelegate. Instances of this class only keep a WeakReference to their delegates. If that Reference has been cleared when an event is received, this listener will remove itself as a listener of the Graph which sent the event. Because of this, it is necessary for the Graph which is using this listener to maintain a strong reference to the ObservableGraphDelegate.

Since:
1.0
Version:
$Revision: 1.3 $
Author:
Ray A. Conner

Constructor Summary
FilteredGraphListener(org.apache.commons.collections.Predicate nodePredicate, org.apache.commons.collections.Predicate edgePredicate, ObservableGraphDelegate observableDelegate)
           
 
Method Summary
 void edgeAdded(GraphEvent event)
          Invoked when an edge has been added to the Graph.
 void edgeRemoved(GraphEvent event)
          Invoked when an edge has been removed from the Graph.
 void nodeAdded(GraphEvent event)
          Invoked when a node has been added to the Graph.
 void nodeRemoved(GraphEvent event)
          Invoked when a node has been removed from the Graph.
 
Methods inherited from class com.phoenixst.plexus.util.ForwardingGraphListener
checkDelegate, fireEdgeAdded, fireEdgeRemoved, fireNodeAdded, fireNodeRemoved
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilteredGraphListener

public FilteredGraphListener(org.apache.commons.collections.Predicate nodePredicate,
                             org.apache.commons.collections.Predicate edgePredicate,
                             ObservableGraphDelegate observableDelegate)
Method Detail

nodeAdded

public void nodeAdded(GraphEvent event)
Description copied from interface: GraphListener
Invoked when a node has been added to the Graph.

Specified by:
nodeAdded in interface GraphListener
Overrides:
nodeAdded in class ForwardingGraphListener

nodeRemoved

public void nodeRemoved(GraphEvent event)
Description copied from interface: GraphListener
Invoked when a node has been removed from the Graph.

Specified by:
nodeRemoved in interface GraphListener
Overrides:
nodeRemoved in class ForwardingGraphListener

edgeAdded

public void edgeAdded(GraphEvent event)
Description copied from interface: GraphListener
Invoked when an edge has been added to the Graph.

Specified by:
edgeAdded in interface GraphListener
Overrides:
edgeAdded in class ForwardingGraphListener

edgeRemoved

public void edgeRemoved(GraphEvent event)
Description copied from interface: GraphListener
Invoked when an edge has been removed from the Graph.

Specified by:
edgeRemoved in interface GraphListener
Overrides:
edgeRemoved in class ForwardingGraphListener

Plexus v0.13.1

See 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.