Package de.caluga.morphium.query
Interface MorphiumIterator<T>
-
- All Known Subinterfaces:
MorphiumAggregationIterator<T,R>
- All Known Implementing Classes:
AggregationIterator,QueryIterator
public interface MorphiumIterator<T> extends Iterable<T>, Iterator<T>
User: Stephan Bösebeck Date: 23.11.12 Time: 11:35 iterator, makes paging through huge collections a lot easier. Default Window (~page) size is 10. This iterator only reads as many objects from mongo as specified in window-size. It can be used like a normal java iterator:for (Object o:query.asIterable()) { //do something here };
-
-
Method Summary
All Methods Instance Methods Abstract 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()List<T>getCurrentBuffer()get the current buffer.intgetCursor()returns current cursor positionMap<String,Object>nextMap()-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, remove
-
-
-
-
Method Detail
-
available
int available()
retruns the number of elements now in buffer. Max windowsize- Returns:
- list
-
getCurrentBuffer
List<T> getCurrentBuffer()
get the current buffer. Maximum length is specified windowsize- Returns:
- list
-
getCursor
int getCursor()
returns current cursor position- Returns:
- int
-
ahead
void ahead(int jump)
move the cursor position ahead- Parameters:
jump- number of elements to jump
-
back
void back(int jump)
get back some positions- Parameters:
jump- number of elements to jump back
-
close
void close()
-
-