Interface OIndexCursor
- All Superinterfaces:
Iterator<OIdentifiable>
- All Known Implementing Classes:
OIndexAbstractCursor,OIndexCursorStream
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 Summary
Modifier and TypeMethodDescriptionReturns nextEntry element in subset of index data which should be iterated by given cursor.voidsetPrefetchSize(int prefetchSize) Set number of records to fetch for the next call to next() or nextEntry().Accumulates and returns all entries of index inside of data subset of cursor.toKeys()Accumulates and returns all keys of index inside of data subset of cursor.toValues()Accumulates and returns all values of index inside of data subset of cursor.Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
Method Details
-
nextEntry
Map.Entry<Object,OIdentifiable> 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
nullif 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
Set<Map.Entry<Object,OIdentifiable>> 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
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.
-