Package net.ggtools.grand.filters
Class FilterChain
- java.lang.Object
-
- net.ggtools.grand.filters.FilterChain
-
- All Implemented Interfaces:
GraphFilter
,GraphConsumer
,GraphProducer
public class FilterChain extends 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
Constructors Constructor Description FilterChain()
Creates an anonymous filter chain.FilterChain(String name)
Creates a named filter chain.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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.List<GraphFilter>
getFilterList()
Returns a list of the filter in the chain.Graph
getGraph()
Method getGraph.String
getName()
Method getName.void
setProducer(GraphProducer newProducer)
Method setProducer.
-
-
-
Constructor Detail
-
FilterChain
public FilterChain()
Creates an anonymous filter chain.
-
FilterChain
public FilterChain(String name)
Creates a named filter chain.- Parameters:
name
- String
-
-
Method Detail
-
addFilterFirst
public final void addFilterFirst(GraphFilter newFilter)
Add a new filter at the beginning of the chain.- Parameters:
newFilter
- GraphFilter
-
addFilterLast
public final void addFilterLast(GraphFilter newFilter)
Adds a new filter at the end of the chain.- Parameters:
newFilter
- GraphFilter
-
clearFilters
public final void clearFilters()
Removes all the filters in the chain.
-
getFilterList
public final List<GraphFilter> getFilterList()
Returns a list of the filter in the chain.- Returns:
- a readonly list of the filters.
-
getGraph
public final Graph getGraph() throws GrandException
Method getGraph.- Specified by:
getGraph
in interfaceGraphProducer
- Returns:
- Graph
- Throws:
GrandException
- if error occurs in GraphProducer#getGraph()- See Also:
GraphProducer.getGraph()
-
getName
public final String getName()
Method getName.- Specified by:
getName
in interfaceGraphFilter
- Returns:
- String
- See Also:
GraphFilter.getName()
-
setProducer
public final void setProducer(GraphProducer newProducer)
Method setProducer.- Specified by:
setProducer
in interfaceGraphConsumer
- Parameters:
newProducer
- GraphProducer- See Also:
GraphConsumer.setProducer(net.ggtools.grand.graph.GraphProducer)
-
-