Class AbstractTupleList.AbstractTupleListIterator
- All Implemented Interfaces:
Iterator<List<Member>>,TupleCursor,TupleIterator
- Enclosing class:
- AbstractTupleList
TupleIterator for
ArrayTupleList.
Based upon AbstractList.Itr, but with concurrent modification checking
removed.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncurrent()Returns the tuple that this cursor is positioned on.voidcurrentToArray(Member[] members, int offset) Writes the member(s) of the next tuple to a given offset in an array.booleanforward()Moves the iterator forward one position.intgetArity()Returns the number of members in each tuple.booleanhasNext()member(int column) next()voidremove()voidsetContext(Evaluator evaluator) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
AbstractTupleListIterator
protected AbstractTupleListIterator()
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
forward
public boolean forward()Description copied from interface:TupleCursorMoves the iterator forward one position.Returns false only when end of data has been reached.
Similar to calling the
IteratormethodsIterator.hasNext()followed byIterator.next()but does not construct an object, and is therefore cheaper.If you want to use an Iterator, see
TupleIterator.- Specified by:
forwardin interfaceTupleCursor- Returns:
- Whether was able to move forward a position
-
current
Description copied from interface:TupleCursorReturns the tuple that this cursor is positioned on.This method never returns null, and may safely be called multiple times (or not all) for each position in the iteration.
Invalid to call this method when the cursor is has not been positioned, for example, if
TupleCursor.forward()has not been called or if the most recent call toforwardreturnedfalse.- Specified by:
currentin interfaceTupleCursor- Returns:
- Current tuple
-
currentToArray
Description copied from interface:TupleCursorWrites the member(s) of the next tuple to a given offset in an array.This method saves the overhead of a memory allocation when the resulting tuple will be written immediately to an array. The effect of
currentToArray(members, 0)is the same as callingcurrent().toArray(members).Before calling this method, you must position the iterator at a valid position. Typically you would call hasNext followed by next; or forward.
- Specified by:
currentToArrayin interfaceTupleCursor- Parameters:
members- Membersoffset- Offset in the array to write to
-
getArity
public int getArity()Description copied from interface:TupleCursorReturns the number of members in each tuple.- Specified by:
getArityin interfaceTupleCursor- Returns:
- The number of members in each tuple
-
remove
public void remove() -
setContext
- Specified by:
setContextin interfaceTupleCursor
-
member
- Specified by:
memberin interfaceTupleCursor
-