Package org.rumbledb.runtime.cursor
Interface Cursor<T>
- Type Parameters:
T- the value type returned by this cursor
- All Superinterfaces:
AutoCloseable
- All Known Implementing Classes:
AbstractLocalCursor,AtMostOneLocalCursor,ConcatLocalCursor,ContextOrArgumentLocalCursor,FlatMappingLocalCursor,IteratorLocalCursor,MappingLocalCursor
Mutable state for one local evaluation of a
RuntimePlan.
A cursor has a single owner, is single-use, and must not be shared between evaluations. Its lifecycle is
created -> open -> closed; closing an already closed cursor should be harmless. A fresh cursor replaces the
reset and cloning operations used by the legacy iterator architecture. Implementations should normally extend
AbstractLocalCursor instead of implementing lifecycle handling themselves.
-
Method Summary
-
Method Details
-
hasNext
boolean hasNext()- Returns:
- whether another value is available Opens the cursor if needed, then returns whether another value is available.
-
next
T next()- Returns:
- the next value Opens the cursor if needed, then returns the next value.
-
close
void close()Releases resources owned by this evaluation. This method is idempotent.- Specified by:
closein interfaceAutoCloseable
-