net.ggtools.grand.filters
Class FilterChain

java.lang.Object
  extended by net.ggtools.grand.filters.FilterChain
All Implemented Interfaces:
GraphFilter, GraphConsumer, GraphProducer

public class FilterChain
extends java.lang.Object
implements GraphFilter

A metafilter made by chaining together several filters. The behaviour of an empty chain is to behave like an identity filter.

Author:
Christophe Labouisse

Constructor Summary
FilterChain()
          Creates an anonymous filter chain.
FilterChain(java.lang.String name)
          Creates a named filter chain.
 
Method Summary
 void addFilterFirst(GraphFilter newFilter)
          Add a new filter at the beginning of the chain.
 void addFilterLast(GraphFilter newFilter)
          Adds a new filter at the end of the chain.
 void clearFilters()
          Removes all the filters in the chain.
 java.util.List getFilterList()
          Returns a list of the filter in the chain.
 Graph getGraph()
          Ask the producer to create a graph.
 java.lang.String getName()
          Get the filter's name.
 void setProducer(GraphProducer newProducer)
          Set the graph producer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterChain

public FilterChain()
Creates an anonymous filter chain.


FilterChain

public FilterChain(java.lang.String name)
Creates a named filter chain.

Parameters:
name -
Method Detail

addFilterFirst

public void addFilterFirst(GraphFilter newFilter)
Add a new filter at the beginning of the chain.

Parameters:
newFilter -

addFilterLast

public void addFilterLast(GraphFilter newFilter)
Adds a new filter at the end of the chain.

Parameters:
newFilter -

clearFilters

public void clearFilters()
Removes all the filters in the chain.


getFilterList

public java.util.List getFilterList()
Returns a list of the filter in the chain.

Returns:
a readonly list of the filters.

getGraph

public Graph getGraph()
               throws GrandException
Description copied from interface: GraphProducer
Ask the producer to create a graph. The created graph can be modified by the caller object.

Specified by:
getGraph in interface GraphProducer
Returns:
new graph.
Throws:
GrandException - is an error occurs contructing the graph.

getName

public java.lang.String getName()
Description copied from interface: GraphFilter
Get the filter's name. Filter naming is just a service for backends and as no impact on the actual filter processing.

Specified by:
getName in interface GraphFilter
Returns:
the filter's name

setProducer

public void setProducer(GraphProducer newProducer)
Description copied from interface: GraphConsumer
Set the graph producer. Such a producer will be called whenever the consumer needs a graph.

Specified by:
setProducer in interface GraphConsumer
Parameters:
newProducer - the producer to get the graph from.


Copyright © 2004-2005 ggTools. All Rights Reserved.