E
- public static class TupleFilter.TupleFilterator<E> extends Object implements ITupleIterator<E>
Tuple
instance by the base ITupleIterator
impls.Modifier and Type | Field and Description |
---|---|
protected Object |
context
The context.
|
protected TupleFilter<E> |
filter |
protected ITupleIterator<E> |
src
The source iterator.
|
Constructor and Description |
---|
TupleFilter.TupleFilterator(ITupleIterator<E> src,
Object context,
TupleFilter<E> filter) |
Modifier and Type | Method and Description |
---|---|
protected ITuple<E> |
getNext()
One step look ahead.
|
boolean |
hasNext() |
ITuple<E> |
next()
Advance the iterator and return the
ITuple from which you can
extract the data and metadata for next entry. |
void |
remove()
Note:
remove() is supported iff the source iterator is an
ITupleCursor and the underlying AbstractBTree allows
modification. |
protected void |
visit(ITuple<E> tuple)
Hook for subclasses.
|
protected final ITupleIterator<E> src
protected final Object context
protected final TupleFilter<E> filter
public TupleFilter.TupleFilterator(ITupleIterator<E> src, Object context, TupleFilter<E> filter)
public ITuple<E> next()
ITupleIterator
ITuple
from which you can
extract the data and metadata for next entry.
Note: An ITupleIterator
s will generally return the same
ITuple
reference on on each invocation of this method. The caller
is responsible for copying out any data or metadata of interest before
calling ITupleIterator.next()
again. See TupleFilter
which is aware of
this and can be used to stack filters safely.
protected void visit(ITuple<E> tuple)
next()
returns. The default implementation is a NOP.tuple
- The tuple that will be visited.public void remove()
remove()
is supported iff the source iterator is an
ITupleCursor
and the underlying AbstractBTree
allows
modification.
Note: The filter imposes a one-step lookahead means that invoking
remove()
on the source iterator would cause the wrong
element to be removed from the source iterator. Therefore this
operation is disabled unless the ITupleCursor
.
ITupleCursor
is safe for traversal with concurrent
modification, so we can just remove the key from the source index.
Note: An ITupleCursor
can be requested either at the
top-level or by specifying IRangeQuery.CURSOR
to
TupleFilter#TupleFilter(int)
.
remove
in interface Iterator<ITuple<E>>
UnsupportedOperationException
- unless the source iterator is an ITupleCursor
.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.