net.ggtools.grand.filters
Class GraphWalkFilter

java.lang.Object
  extended by net.ggtools.grand.filters.AbstractGraphFilter
      extended by net.ggtools.grand.filters.GraphWalkFilter
All Implemented Interfaces:
GraphFilter, GraphConsumer, GraphProducer
Direct Known Subclasses:
ConnectedToNodeFilter, FromNodeFilter, ToNodeFilter

public abstract class GraphWalkFilter
extends AbstractGraphFilter
implements GraphFilter

An abstract class implementing generic filtering from a graph walk. Derived class need to implemented the getLinkFinder method.

Author:
Christophe Labouisse

Field Summary
 
Fields inherited from class net.ggtools.grand.filters.AbstractGraphFilter
name
 
Constructor Summary
GraphWalkFilter(java.lang.String nodeName)
          Creates a new filter.
 
Method Summary
protected  java.util.Collection getFilteredNodes()
          Get the nodes from the graph that pass the filter.
abstract  LinkFinder getLinkFinder()
          Returns an object finding the links to follow from a specific node.
 
Methods inherited from class net.ggtools.grand.filters.AbstractGraphFilter
getGraph, getGraphProducer, getName, getProducersGraph, setProducer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.ggtools.grand.filters.GraphFilter
getName
 
Methods inherited from interface net.ggtools.grand.graph.GraphProducer
getGraph
 
Methods inherited from interface net.ggtools.grand.graph.GraphConsumer
setProducer
 

Constructor Detail

GraphWalkFilter

public GraphWalkFilter(java.lang.String nodeName)
Creates a new filter.

Parameters:
nodeName - node to search from.
Method Detail

getFilteredNodes

protected java.util.Collection getFilteredNodes()
                                         throws GrandException
Description copied from class: AbstractGraphFilter
Get the nodes from the graph that pass the filter. This method should not alter the input graph. The returned collection may be read only and return UnsupportedOperationExceptionon modification methods.

Specified by:
getFilteredNodes in class AbstractGraphFilter
Returns:
a collection of nodes.
Throws:
GrandException - if the filtering cannot be done

getLinkFinder

public abstract LinkFinder getLinkFinder()
Returns an object finding the links to follow from a specific node. This object will be used when walking the graph in getFilteredNodes() to find the filtered nodes.

Returns:
the LinkFinder object used for filtering.
See Also:
LinkFinder


Copyright © 2004-2005 ggTools. All Rights Reserved.