Interface OIndexCursor

All Superinterfaces:
Iterator<OIdentifiable>
All Known Implementing Classes:
OIndexAbstractCursor, OIndexCursorStream

public interface OIndexCursor extends Iterator<OIdentifiable>
Presentation of OrientDB index cursor for point and range queries. Cursor may iterate by several elements even if you do point query (query by single key). It is possible if you use not unique index.

Contract of cursor is simple it iterates in some subset of index data till it reaches it's borders in such case nextEntry() returns null.

Cursor is created as result of index query method such as com.orientechnologies.orient.core.index.OIndex#streamEntriesBetween(Object, boolean, Object, boolean, boolean) cursor instance cannot be used at several threads simultaneously.

Since:
4/4/14
Author:
Andrey Lomakin (a.lomakin-at-orientdb.com)
  • Method Details

    • nextEntry

      Returns nextEntry element in subset of index data which should be iterated by given cursor.
      Returns:
      nextEntry element in subset of index data which should be iterated by given cursor or null if all data are iterated.
    • toValues

      Set<OIdentifiable> toValues()
      Accumulates and returns all values of index inside of data subset of cursor.
      Returns:
      all values of index inside of data subset of cursor.
    • toEntries

      Accumulates and returns all entries of index inside of data subset of cursor.
      Returns:
      all entries of index inside of data subset of cursor.
    • toKeys

      Set<Object> toKeys()
      Accumulates and returns all keys of index inside of data subset of cursor.
      Returns:
      all keys of index inside of data subset of cursor.
    • setPrefetchSize

      void setPrefetchSize(int prefetchSize)
      Set number of records to fetch for the next call to next() or nextEntry().
      Parameters:
      prefetchSize - Number of records to prefetch. -1 = prefetch using default settings.