Interface MorphiumIterator<T>

  • All Superinterfaces:
    Iterable<T>, Iterator<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 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()