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

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

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

QueryExecutor which fully scans an iterable collection.

Author:
Brian S O'Neill
See Also:
IteratorCursor

Constructor Summary
IterableQueryExecutor(Class<S> type, Iterable<S> iterable)
           
IterableQueryExecutor(Class<S> type, Iterable<S> iterable, Lock lock)
           
 
Method Summary
 Cursor<S> fetch(FilterValues<S> values)
          Returns a new cursor using the given filter values.
 Filter<S> getFilter()
          Returns an open filter.
 OrderingList<S> getOrdering()
          Returns an empty list.
 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, printNative
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IterableQueryExecutor

public IterableQueryExecutor(Class<S> type,
                             Iterable<S> iterable)
Parameters:
type - type of Storable
iterable - collection to iterate over, or null for empty cursor
Throws:
IllegalArgumentException - if type is null

IterableQueryExecutor

public IterableQueryExecutor(Class<S> type,
                             Iterable<S> iterable,
                             Lock lock)
Parameters:
type - type of Storable
iterable - collection to iterate over, or null for empty cursor
lock - optional lock to hold while cursor is open
Throws:
IllegalArgumentException - if type is null
Method Detail

getFilter

public Filter<S> getFilter()
Returns an open filter.

Returns:
query filter, never null

fetch

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


getOrdering

public OrderingList<S> getOrdering()
Returns an empty list.

Returns:
query ordering in an unmodifiable list

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.