|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface TupleCursor
Cheap interface for iterating through the contents of a TupleList.
Stops short of the full Iterator interface. If you want
that, see TupleIterator.
| Method Summary | |
|---|---|
List<Member> |
current()
Returns the tuple that this cursor is positioned on. |
void |
currentToArray(Member[] members,
int offset)
Writes the member(s) of the next tuple to a given offset in an array. |
boolean |
forward()
Moves the iterator forward one position. |
int |
getArity()
Returns the number of members in each tuple. |
Member |
member(int column)
|
void |
setContext(Evaluator evaluator)
|
| Method Detail |
|---|
void setContext(Evaluator evaluator)
boolean forward()
Returns false only when end of data has been reached.
Similar to calling the Iterator methods
Iterator.hasNext() followed by
Iterator.next() but
does not construct an object, and is therefore cheaper.
If you want to use an Iterator, see TupleIterator.
List<Member> current()
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 forward() has not been called or
if the most recent call to forward returned false.
int getArity()
Member member(int column)
void currentToArray(Member[] members,
int offset)
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 calling
current().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.
members - Membersoffset - Offset in the array to write to
|
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||