Package de.caluga.morphium.query
Class QueryIterator<T>
java.lang.Object
de.caluga.morphium.query.QueryIterator<T>
- All Implemented Interfaces:
MorphiumIterator<T>,Iterable<T>,Iterator<T>
public class QueryIterator<T>
extends Object
implements MorphiumIterator<T>, Iterator<T>, Iterable<T>
User: Stephan Bösebeck
Date: 25.03.16
Time: 22:33
iterating over huge collections using the mongodb internal cursor
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidahead(int jump) move the cursor position aheadintretruns the number of elements now in buffer.voidback(int jump) get back some positionsvoidclose()longgetCount()get the current buffer.intreturns current cursor positiongetQuery()intbooleanhasNext()iterator()next()nextMap()voidsetWindowSize(int windowSize) 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, remove
-
Constructor Details
-
QueryIterator
public QueryIterator()
-
-
Method Details
-
getWindowSize
public int getWindowSize() -
setWindowSize
-
getQuery
-
setQuery
-
getCount
public long getCount() -
ahead
public void ahead(int jump) Description copied from interface:MorphiumIteratormove the cursor position ahead- Specified by:
aheadin interfaceMorphiumIterator<T>- Parameters:
jump- number of elements to jump
-
back
public void back(int jump) Description copied from interface:MorphiumIteratorget back some positions- Specified by:
backin interfaceMorphiumIterator<T>- Parameters:
jump- number of elements to jump back
-
available
public int available()Description copied from interface:MorphiumIteratorretruns the number of elements now in buffer. Max windowsize- Specified by:
availablein interfaceMorphiumIterator<T>- Returns:
- list
-
iterator
-
hasNext
public boolean hasNext() -
nextMap
- Specified by:
nextMapin interfaceMorphiumIterator<T>
-
next
-
getCurrentBuffer
Description copied from interface:MorphiumIteratorget the current buffer. Maximum length is specified windowsize- Specified by:
getCurrentBufferin interfaceMorphiumIterator<T>- Returns:
- list
-
close
public void close()- Specified by:
closein interfaceMorphiumIterator<T>
-
getCursor
public int getCursor()Description copied from interface:MorphiumIteratorreturns current cursor position- Specified by:
getCursorin interfaceMorphiumIterator<T>- Returns:
- int
-
getMongoCursor
-