org.umber.bellows.query
Class RangeFilter

java.lang.Object
  extended byorg.umber.bellows.query.QueryProcessor
      extended byorg.umber.bellows.query.RangeFilter
All Implemented Interfaces:
INodeProcessor

public class RangeFilter
extends QueryProcessor

A query filter to extract Datum objects from a List based on a consecutive span of children between a start and end index. Returns all children from the start index (inclusive) to just before the end index (exclusive).

Author:
jsheets
See Also:
DatumQuery

Constructor Summary
RangeFilter(int startIndex)
          Creates a new instance of RangeFilter, from startIndex to the end of the node list.
RangeFilter(int startIndex, int endIndex)
          Creates a new instance of RangeFilter, for the given range.
RangeFilter(int startIndex, int endIndex, int count)
          Creates a new instance of RangeFilter, for the given range.
 
Method Summary
 boolean shouldProcess(java.lang.Object node)
          Determines if the given object should be processed during the traversal.
 void start(java.util.List nodes)
          Starts a new traversal.
 
Methods inherited from class org.umber.bellows.query.QueryProcessor
end, processNode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RangeFilter

public RangeFilter(int startIndex)
Creates a new instance of RangeFilter, from startIndex to the end of the node list.

Parameters:
startIndex - the beginning filter range index

RangeFilter

public RangeFilter(int startIndex,
                   int endIndex)
Creates a new instance of RangeFilter, for the given range.

Parameters:
startIndex - the beginning filter range index
endIndex - the ending filter range index

RangeFilter

public RangeFilter(int startIndex,
                   int endIndex,
                   int count)
Creates a new instance of RangeFilter, for the given range.

Parameters:
startIndex - the beginning filter range index
endIndex - the ending filter range index
count - the number of nodes in the selection to filter
Method Detail

start

public void start(java.util.List nodes)
Starts a new traversal. This method initializes the processor for a new traversal over a set of nodes. The nodes are not actually traversed or processed at this point, but the processor is allowed to perform any pre-traversal calculations, for example storing the total number of nodes for index calculations.

Specified by:
start in interface INodeProcessor
Overrides:
start in class QueryProcessor
Parameters:
nodes - the list of nodes that will later be traversed

shouldProcess

public boolean shouldProcess(java.lang.Object node)
Determines if the given object should be processed during the traversal.

Specified by:
shouldProcess in class QueryProcessor
Parameters:
node - the object to test
Returns:
true if the object should be processed