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>>
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
DBSQueryResult(PartialList<Map<String,Serializable>> pl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes the query result and releases the underlying resources held by the cursor.boolean
hasNext()
boolean
isLife()
Indicates if the query result has not been closedIterator<Map<String,Serializable>>
iterator()
boolean
mustBeClosed()
Indicates if the query result must be closed (because it holds resources).Map<String,Serializable>
next()
long
pos()
Gets the current position in the iterator.void
remove()
long
size()
Gets the total size of the query result.void
skipTo(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, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Field Detail
-
maps
protected List<Map<String,Serializable>> maps
-
totalSize
protected long totalSize
-
pos
protected long pos
-
-
Constructor Detail
-
DBSQueryResult
protected DBSQueryResult(PartialList<Map<String,Serializable>> pl)
-
-
Method Detail
-
iterator
public Iterator<Map<String,Serializable>> iterator()
- Specified by:
iterator
in interfaceIterable<Map<String,Serializable>>
-
close
public void close()
Description copied from interface:IterableQueryResult
Closes 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:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in interfaceIterableQueryResult
-
isLife
public boolean isLife()
Description copied from interface:IterableQueryResult
Indicates if the query result has not been closed- Specified by:
isLife
in interfaceIterableQueryResult
-
mustBeClosed
public boolean mustBeClosed()
Description copied from interface:IterableQueryResult
Indicates if the query result must be closed (because it holds resources).- Specified by:
mustBeClosed
in interfaceIterableQueryResult
- Returns:
true
if the query result must be closed,false
otherwise
-
size
public long size()
Description copied from interface:IterableQueryResult
Gets 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
-1
will be returned.- Specified by:
size
in interfaceIterableQueryResult
- Returns:
- the size, or
-1
for an unknown size
-
pos
public long pos()
Description copied from interface:IterableQueryResult
Gets the current position in the iterator.Positions start at
0
.- Specified by:
pos
in interfaceIterableQueryResult
- Returns:
- the position
-
skipTo
public void skipTo(long pos)
Description copied from interface:IterableQueryResult
Skips to a given position in the iterator.Positions start at
0
.- Specified by:
skipTo
in interfaceIterableQueryResult
-
hasNext
public boolean hasNext()
- Specified by:
hasNext
in interfaceIterator<Map<String,Serializable>>
-
next
public Map<String,Serializable> next()
- Specified by:
next
in interfaceIterator<Map<String,Serializable>>
-
remove
public void remove()
- Specified by:
remove
in interfaceIterator<Map<String,Serializable>>
-
-