org.archive.wayback.util
Class ObjectFilterChain<E>

java.lang.Object
  extended by org.archive.wayback.util.ObjectFilterChain<E>
Type Parameters:
E -
All Implemented Interfaces:
ObjectFilter<E>

public class ObjectFilterChain<E>
extends Object
implements ObjectFilter<E>

ObjectFilterChain implements AND logic to chain together multiple ObjectFilters into a composite. ABORT and EXCLUDE short circuit the chain, all filters must INCLUDE for inclusion.

Version:
$Date: 2010-09-29 05:28:38 +0700 (Wed, 29 Sep 2010) $, $Revision: 3262 $
Author:
brad

Field Summary
 
Fields inherited from interface org.archive.wayback.util.ObjectFilter
FILTER_ABORT, FILTER_EXCLUDE, FILTER_INCLUDE
 
Constructor Summary
ObjectFilterChain()
          Constructor
 
Method Summary
 void addFilter(ObjectFilter<E> filter)
           
 void addFilters(Collection<ObjectFilter<E>> list)
           
 int filterObject(E o)
          inpect record and determine if it should be included in the results or not, or if processing of new records should stop.
 ArrayList<ObjectFilter<E>> getFilters()
           
 void setFilters(ArrayList<ObjectFilter<E>> filters)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectFilterChain

public ObjectFilterChain()
Constructor

Method Detail

getFilters

public ArrayList<ObjectFilter<E>> getFilters()
Returns:
the filters

setFilters

public void setFilters(ArrayList<ObjectFilter<E>> filters)
Parameters:
filters - the filters to set

addFilter

public void addFilter(ObjectFilter<E> filter)
Parameters:
filter - to be added to the chain. filters are processed in the order they are added to the chain.

addFilters

public void addFilters(Collection<ObjectFilter<E>> list)

filterObject

public int filterObject(E o)
Description copied from interface: ObjectFilter
inpect record and determine if it should be included in the results or not, or if processing of new records should stop.

Specified by:
filterObject in interface ObjectFilter<E>
Parameters:
o - Object which should be checked for inclusion/exclusion or abort
Returns:
int of FILTER_INCLUDE, FILTER_EXCLUDE, or FILTER_ABORT


Copyright © 2005-2011 Internet Archive. All Rights Reserved.