public abstract class FilteredCursor<S> extends AbstractCursor<S>
Modifier | Constructor and Description |
---|---|
protected |
FilteredCursor(Cursor<S> cursor) |
Modifier and Type | Method and Description |
---|---|
static <S extends Storable> |
applyFilter(Cursor<S> cursor,
java.lang.Class<S> type,
java.lang.String filter,
java.lang.Object... filterValues)
Returns a Cursor that is filtered by the given filter expression and values.
|
static <S extends Storable> |
applyFilter(Filter<S> filter,
FilterValues<S> filterValues,
Cursor<S> cursor)
Returns a Cursor that is filtered by the given Filter and FilterValues.
|
void |
close()
Call close to release any resources being held by this cursor.
|
boolean |
hasNext()
Returns true if this cursor has more elements.
|
protected abstract boolean |
isAllowed(S storable) |
S |
next()
Returns the next element from this cursor.
|
int |
skipNext(int amount)
Skips forward by the specified amount of elements, returning the actual
amount skipped.
|
copyInto, copyInto, toList, toList
public static <S extends Storable> Cursor<S> applyFilter(Cursor<S> cursor, java.lang.Class<S> type, java.lang.String filter, java.lang.Object... filterValues)
cursor
- cursor to wraptype
- type of storablefilter
- filter to applyfilterValues
- values for filterjava.lang.IllegalStateException
- if any values are not specifiedjava.lang.IllegalArgumentException
- if any argument is nullpublic static <S extends Storable> Cursor<S> applyFilter(Filter<S> filter, FilterValues<S> filterValues, Cursor<S> cursor)
filter
- filter to applyfilterValues
- values for filter, which may be null if filter has no parameterscursor
- cursor to wrapjava.lang.IllegalStateException
- if any values are not specifiedjava.lang.IllegalArgumentException
- if filter is closedprotected abstract boolean isAllowed(S storable) throws FetchException
FetchException
public void close() throws FetchException
Cursor
FetchException
public boolean hasNext() throws FetchException
Cursor
next
would return an element rather than throwing
an exception.FetchException
- if storage layer throws an exceptionpublic S next() throws FetchException
Cursor
FetchException
- if storage layer throws an exceptionpublic int skipNext(int amount) throws FetchException
Cursor
skipNext
in interface Cursor<S>
skipNext
in class AbstractCursor<S>
amount
- maximum amount of elements to skipFetchException
- if storage layer throws an exceptionCopyright © 2006-2013 Amazon Technologies, Inc.. All Rights Reserved.