Package org.nuxeo.ecm.core.storage.dbs
Class DBSSession.DBSQueryResult
java.lang.Object
org.nuxeo.ecm.core.storage.dbs.DBSSession.DBSQueryResult
- All Implemented Interfaces:
Closeable,AutoCloseable,Iterable<Map<String,,Serializable>> Iterator<Map<String,,Serializable>> IterableQueryResult
- Enclosing class:
DBSSession
protected static class DBSSession.DBSQueryResult
extends Object
implements IterableQueryResult, Iterator<Map<String,Serializable>>
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes the query result and releases the underlying resources held by the cursor.booleanhasNext()iterator()booleanIndicates if the query result must be closed (because it holds resources).next()longpos()Gets the current position in the iterator.voidremove()longsize()Gets the total size of the query result.voidskipTo(long pos) Skips to a given position in the iterator.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
maps
-
totalSize
protected long totalSize -
pos
protected long pos
-
-
Constructor Details
-
DBSQueryResult
-
-
Method Details
-
iterator
- Specified by:
iteratorin interfaceIterable<Map<String,Serializable>>
-
close
public void close()Description copied from interface:IterableQueryResultCloses the query result and releases the underlying resources held by the cursor.This MUST be called when the query result is no more needed, otherwise underlying resources will be leaked. There is no auto-closing at the end of the iteration.
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceIterableQueryResult
-
mustBeClosed
public boolean mustBeClosed()Description copied from interface:IterableQueryResultIndicates if the query result must be closed (because it holds resources).- Specified by:
mustBeClosedin interfaceIterableQueryResult- Returns:
trueif the query result must be closed,falseotherwise
-
size
public long size()Description copied from interface:IterableQueryResultGets the total size of the query result.Note that this may be costly, and that some backends may not be able to do this operation, in which case
-1will be returned.- Specified by:
sizein interfaceIterableQueryResult- Returns:
- the size, or
-1for an unknown size
-
pos
public long pos()Description copied from interface:IterableQueryResultGets the current position in the iterator.Positions start at
0.- Specified by:
posin interfaceIterableQueryResult- Returns:
- the position
-
skipTo
public void skipTo(long pos) Description copied from interface:IterableQueryResultSkips to a given position in the iterator.Positions start at
0.- Specified by:
skipToin interfaceIterableQueryResult
-
hasNext
public boolean hasNext()- Specified by:
hasNextin interfaceIterator<Map<String,Serializable>>
-
next
- Specified by:
nextin interfaceIterator<Map<String,Serializable>>
-
remove
public void remove()- Specified by:
removein interfaceIterator<Map<String,Serializable>>
-