Package org.rumbledb.runtime.cursor
Class AbstractLocalCursor<T>
java.lang.Object
org.rumbledb.runtime.cursor.AbstractLocalCursor<T>
- Type Parameters:
T- the value type returned by this cursor
- All Implemented Interfaces:
AutoCloseable,Cursor<T>
- Direct Known Subclasses:
AtMostOneLocalCursor,ConcatLocalCursor,ContextOrArgumentLocalCursor,FlatMappingLocalCursor,IteratorLocalCursor,MappingLocalCursor
Lifecycle template for local cursors.
Implementations only manage evaluation-specific state in the four local methods. This class opens a cursor on its first read, enforces the single-use lifecycle, and performs best-effort cleanup if opening fails.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidclose()Releases resources owned by this evaluation.protected abstract voidprotected final ExceptionMetadatafinal booleanhasNext()protected abstract booleanprotected final RuntimeExceptioninvalidState(String message) Creates the exception used for invalid lifecycle calls.final Tnext()protected abstract Tprotected abstract void
-
Constructor Details
-
AbstractLocalCursor
-
-
Method Details
-
hasNext
public final boolean hasNext() -
next
-
close
public final void close()Description copied from interface:CursorReleases resources owned by this evaluation. This method is idempotent.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCursor<T>
-
openLocal
protected abstract void openLocal() -
hasNextLocal
protected abstract boolean hasNextLocal() -
nextLocal
-
closeLocal
protected abstract void closeLocal() -
invalidState
Creates the exception used for invalid lifecycle calls.- Parameters:
message- the lifecycle error- Returns:
- the exception to throw
-
getMetadata
-