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>

public class ArangoCursorImpl<T> extends Object implements ArangoCursor<T>
Author:
Mark Vollmary
  • Field Details

  • Constructor Details

  • Method Details

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • next

      public T next()
      Description copied from interface: ArangoCursor
      Returns the next element in the iteration.

      If the cursor allows retries (see AqlQueryOptions.allowRetry(Boolean)), then it is safe to retry invoking this method in case of I/O exceptions (which are actually thrown as ArangoDBException with cause IOException).

      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).

      Specified by:
      next in interface ArangoCursor<T>
      Specified by:
      next in interface Iterator<T>
      Returns:
      the next element in the iteration
    • getId

      public String getId()
      Specified by:
      getId in interface ArangoCursor<T>
      Returns:
      id of temporary cursor created on the server
    • getType

      public Class<T> getType()
      Specified by:
      getType in interface ArangoCursor<T>
      Returns:
      the type of the result elements
    • getCount

      public Integer getCount()
      Specified by:
      getCount in interface ArangoCursor<T>
      Returns:
      the total number of result documents available (only available if the query was executed with the count attribute set)
    • getStats

      public CursorStats getStats()
      Specified by:
      getStats in interface ArangoCursor<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

      public Collection<CursorWarning> getWarnings()
      Specified by:
      getWarnings in interface ArangoCursor<T>
      Returns:
      warnings which the query could have been produced
    • isCached

      public boolean isCached()
      Specified by:
      isCached in interface ArangoCursor<T>
      Returns:
      indicating whether the query result was served from the query cache or not
    • hasNext

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<T>
    • isPotentialDirtyRead

      public boolean isPotentialDirtyRead()
      Specified by:
      isPotentialDirtyRead in interface ArangoCursor<T>
      Returns:
      true if the result is a potential dirty read
    • iterator

      public ArangoIterator<T> iterator()
      Specified by:
      iterator in interface ArangoIterable<T>
      Specified by:
      iterator in interface Iterable<T>
    • getNextBatchId

      public String getNextBatchId()
      Specified by:
      getNextBatchId in interface ArangoCursor<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

      protected ArangoCursorExecute<T> getExecute()