public class SerialFilter extends java.lang.Object implements Filter, EfficientFilter
Filter f1 = new HeightFilter( "tall" );
Filter f2 = new ColorFilter("Green");
Filter serial = new SerialFilter( f1, f2 );
Graph tallGreen = serial.filter( graph ).assemble();
// this contains all tall, green things
f1.setHeight("short")
// careful, f1 is stored in serial!
Graph otherGreen = serial.filter( graph ).assemble();
// this now contains all short green things.
Constructor and Description |
---|
SerialFilter()
Creates an empty list of filters.
|
SerialFilter(Filter f1,
Filter f2)
Small constructor for two filters.
|
SerialFilter(java.util.List filters)
Constructor for an arbitrary list of filters.
|
Modifier and Type | Method and Description |
---|---|
void |
append(Filter f)
Adds a filter to the end of the sequence of filters.
|
UnassembledGraph |
filter(Graph g)
Runs through the sequence of filters, one at a time.
|
UnassembledGraph |
filter(UnassembledGraph g)
Runs through the sequence of filters, one at a time.
|
java.lang.String |
getName()
Returns the name of the serial filter.
|
public SerialFilter(Filter f1, Filter f2)
f1
- The first filter.f2
- The second filter.public SerialFilter(java.util.List filters)
public SerialFilter()
TrivialFilter
public java.lang.String getName()
public void append(Filter f)
f
- Adds the filter to the end of the list.public UnassembledGraph filter(Graph g)
public UnassembledGraph filter(UnassembledGraph g)
filter
in interface EfficientFilter
g
- An unassembled graph to be filtered.