com.bigdata.btree.filter
Class TupleFilter<E>

java.lang.Object
  extended by com.bigdata.btree.filter.TupleFilter<E>
Type Parameters:
E - The type of the elements visited by the iterator (tuples of some sort).
All Implemented Interfaces:
ITupleFilter<E>, cutthecrap.utils.striterators.IFilter, Serializable
Direct Known Subclasses:
AbstractAccessPath.ElementFilter, TupleUpdater

public abstract class TupleFilter<E>
extends Object
implements ITupleFilter<E>

Filter supporting ITupleIterators.

Warning: Unlike Filter, this class correctly uses a second Tuple instance to perform filtering. This is necessary since the Tuple instance for the base ITupleIterator implementations for the AbstractBTree is reused by next() on each call and the TupleFilter uses one-step lookahead. Failure to use a second Tuple instance will result in overwrite of the current Tuple with data from the lookahead Tuple.

Note: You must specify IRangeQuery.KEYS and/or IRangeQuery.VALS in order to filter on the keys and/or values associated with the visited tuples.

Note: YOu must specify IRangeQuery.CURSOR to enabled Iterator.remove() for a local BTree

Version:
$Id: TupleFilter.java 2265 2009-10-26 12:51:06Z thompsonbry $
Author:
Bryan Thompson
See Also:
Serialized Form

Nested Class Summary
protected  class TupleFilter.Filterator
          Implementation class knows how to avoid side-effects from the reuse of the same Tuple instance by the base ITupleIterator impls.
 
Field Summary
protected static org.apache.log4j.Logger log
           
protected  Object state
          Optional state specified by the ctor.
 
Constructor Summary
TupleFilter()
           
TupleFilter(Object state)
           
 
Method Summary
 ITupleIterator<E> filter(Iterator src)
          Strengthened return type.
protected abstract  boolean isValid(ITuple<E> tuple)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected static final transient org.apache.log4j.Logger log

state

protected Object state
Optional state specified by the ctor.

Constructor Detail

TupleFilter

public TupleFilter()

TupleFilter

public TupleFilter(Object state)
Method Detail

filter

public ITupleIterator<E> filter(Iterator src)
Description copied from interface: ITupleFilter
Strengthened return type.

Specified by:
filter in interface ITupleFilter<E>
Specified by:
filter in interface cutthecrap.utils.striterators.IFilter

isValid

protected abstract boolean isValid(ITuple<E> tuple)


Copyright © 2006-2009 SYSTAP, LLC. All Rights Reserved.