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:33iterating over huge collections using the mongodb internal cursor
-
-
Constructor Summary
Constructors Constructor Description QueryIterator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidahead(int jump)move the cursor position aheadintavailable()retruns the number of elements now in buffer.voidback(int jump)get back some positionsvoidclose()longgetCount()List<T>getCurrentBuffer()get the current buffer.intgetCursor()returns current cursor positionMorphiumCursorgetMongoCursor()Query<T>getQuery()intgetWindowSize()booleanhasNext()Iterator<T>iterator()Tnext()Map<String,Object>nextMap()voidsetQuery(Query<T> q)QueryIterator<T>setWindowSize(int windowSize)-
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, remove
-
-
-
-
Method Detail
-
getWindowSize
public int getWindowSize()
-
setWindowSize
public QueryIterator<T> setWindowSize(int windowSize)
-
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
-
getCurrentBuffer
public List<T> 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
public MorphiumCursor getMongoCursor()
-
-