com.amazon.carbonado.qe
Class FilteredQueryExecutor<S extends Storable>

java.lang.Object
  extended by com.amazon.carbonado.qe.AbstractQueryExecutor<S>
      extended by com.amazon.carbonado.qe.FilteredQueryExecutor<S>
All Implemented Interfaces:
QueryExecutor<S>

public class FilteredQueryExecutor<S extends Storable>
extends AbstractQueryExecutor<S>

QueryExecutor which wraps another and filters results.

Author:
Brian S O'Neill
See Also:
FilteredCursor

Constructor Summary
FilteredQueryExecutor(QueryExecutor<S> executor, Filter<S> filter)
           
 
Method Summary
 Cursor<S> fetch(FilterValues<S> values)
          Returns a new cursor using the given filter values.
 Filter<S> getFilter()
          Returns the combined filter of the wrapped executor and the extra filter.
 OrderingList<S> getOrdering()
          Returns the result ordering of this QueryExecutor.
 boolean printNative(Appendable app, int indentLevel, FilterValues<S> values)
          Prints native query of the wrapped executor.
 boolean printPlan(Appendable app, int indentLevel, FilterValues<S> values)
          Prints the query plan to any appendable, if applicable.
 
Methods inherited from class com.amazon.carbonado.qe.AbstractQueryExecutor
count, fetchSlice, getStorableType, increaseIndent, indent, newline
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilteredQueryExecutor

public FilteredQueryExecutor(QueryExecutor<S> executor,
                             Filter<S> filter)
Parameters:
executor - executor to wrap
filter - filter to apply to cursor
Throws:
IllegalArgumentException - if any argument is null or filter is open or closed
Method Detail

fetch

public Cursor<S> fetch(FilterValues<S> values)
                                 throws FetchException
Description copied from interface: QueryExecutor
Returns a new cursor using the given filter values.

Throws:
FetchException

getFilter

public Filter<S> getFilter()
Returns the combined filter of the wrapped executor and the extra filter.

Returns:
query filter, never null

getOrdering

public OrderingList<S> getOrdering()
Description copied from interface: QueryExecutor
Returns the result ordering of this QueryExecutor.

Returns:
query ordering in an unmodifiable list

printNative

public boolean printNative(Appendable app,
                           int indentLevel,
                           FilterValues<S> values)
                    throws IOException
Prints native query of the wrapped executor.

Specified by:
printNative in interface QueryExecutor<S extends Storable>
Overrides:
printNative in class AbstractQueryExecutor<S extends Storable>
values - optional
Returns:
false if not implemented
Throws:
IOException

printPlan

public boolean printPlan(Appendable app,
                         int indentLevel,
                         FilterValues<S> values)
                  throws IOException
Description copied from interface: QueryExecutor
Prints the query plan to any appendable, if applicable.

values - optional
Returns:
false if not implemented
Throws:
IOException


Copyright © 2006-2009 Amazon Technologies, Inc.. All Rights Reserved.