Package com.arangodb.internal.cursor
Class ArangoCursorImpl<T>
java.lang.Object
com.arangodb.internal.cursor.ArangoCursorImpl<T>
- All Implemented Interfaces:
ArangoCursor<T>
,ArangoIterable<T>
,ArangoIterator<T>
,Closeable
,AutoCloseable
,Iterable<T>
,Iterator<T>
- Author:
- Mark Vollmary
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionArangoCursorImpl
(ArangoCursorExecute<T> execute, Class<T> type, CursorEntity<T> result, Boolean allowRetry) -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.arangodb.ArangoCursor
asListRemaining
Methods inherited from interface com.arangodb.ArangoIterable
stream
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
Field Details
-
iterator
-
-
Constructor Details
-
ArangoCursorImpl
public ArangoCursorImpl(ArangoCursorExecute<T> execute, Class<T> type, CursorEntity<T> result, Boolean allowRetry)
-
-
Method Details
-
close
public void close()- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
next
Description copied from interface:ArangoCursor
Returns the next element in the iteration. If the cursor allows retries (seeAqlQueryOptions.allowRetry(Boolean)
), then it is safe to retry invoking this method in case of I/O exceptions (which are actually thrown asArangoDBException
with causeIOException
). If the cursor does not allow retries (default), then it is not safe to retry invoking this method in case of I/O exceptions, since the request to fetch the next batch is not idempotent (i.e. the cursor may advance multiple times on the server). -
getId
- Specified by:
getId
in interfaceArangoCursor<T>
- Returns:
- id of temporary cursor created on the server
-
getType
- Specified by:
getType
in interfaceArangoCursor<T>
- Returns:
- the type of the result elements
-
getCount
- Specified by:
getCount
in interfaceArangoCursor<T>
- Returns:
- the total number of result documents available (only available if the query was executed with the count attribute set)
-
getStats
- Specified by:
getStats
in interfaceArangoCursor<T>
- Returns:
- extra information about the query result. For data-modification queries, the stats will contain the number of modified documents and the number of documents that could not be modified due to an error (if ignoreErrors query option is specified)
-
getWarnings
- Specified by:
getWarnings
in interfaceArangoCursor<T>
- Returns:
- warnings which the query could have been produced
-
isCached
public boolean isCached()- Specified by:
isCached
in interfaceArangoCursor<T>
- Returns:
- indicating whether the query result was served from the query cache or not
-
hasNext
public boolean hasNext() -
isPotentialDirtyRead
public boolean isPotentialDirtyRead()- Specified by:
isPotentialDirtyRead
in interfaceArangoCursor<T>
- Returns:
- true if the result is a potential dirty read
-
iterator
-
getNextBatchId
- Specified by:
getNextBatchId
in interfaceArangoCursor<T>
- Returns:
- The ID of the batch after the current one. The first batch has an ID of 1 and the value is incremented by 1 with every batch. Only set if the allowRetry query option is enabled.
-
getExecute
-