Package de.caluga.morphium.aggregation
Class AggregationIterator<T,R>
- java.lang.Object
-
- de.caluga.morphium.aggregation.AggregationIterator<T,R>
-
- All Implemented Interfaces:
MorphiumAggregationIterator<T,R>,MorphiumIterator<R>,Iterable<R>,Iterator<R>
public class AggregationIterator<T,R> extends Object implements MorphiumAggregationIterator<T,R>
User: Stephan Bösebeck Date: 25.03.16 Time: 22:33iterating over huge collections using the mongodb internal cursor
-
-
Constructor Summary
Constructors Constructor Description AggregationIterator()
-
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()Aggregator<T,R>getAggregator()List<R>getCurrentBuffer()get the current buffer.intgetCursor()returns current cursor positionbooleanhasNext()Iterator<R>iterator()Rnext()Map<String,Object>nextMap()voidsetAggregator(Aggregator<T,R> aggregator)-
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
-
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<R> 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
-
getAggregator
public Aggregator<T,R> getAggregator()
- Specified by:
getAggregatorin interfaceMorphiumAggregationIterator<T,R>
-
setAggregator
public void setAggregator(Aggregator<T,R> aggregator)
- Specified by:
setAggregatorin interfaceMorphiumAggregationIterator<T,R>
-
-