Class AbstractTupleList.AbstractTupleListIterator

    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) int cursor
      Index of element to be returned by subsequent call to next.
      (package private) int lastRet
      Index of element returned by most recent call to next or previous.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<Member> current()
      Returns the tuple that this cursor is positioned on.
      void currentToArray​(Member[] members, int offset)
      Writes the member(s) of the next tuple to a given offset in an array.
      boolean forward()
      Moves the iterator forward one position.
      int getArity()
      Returns the number of members in each tuple.
      boolean hasNext()  
      Member member​(int column)  
      java.util.List<Member> next()  
      void remove()  
      void setContext​(Evaluator evaluator)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Iterator

        forEachRemaining
    • Field Detail

      • cursor

        int cursor
        Index of element to be returned by subsequent call to next.
      • lastRet

        int lastRet
        Index of element returned by most recent call to next or previous. Reset to -1 if this element is deleted by a call to remove.
    • Constructor Detail

      • AbstractTupleListIterator

        protected AbstractTupleListIterator()
    • Method Detail

      • hasNext

        public boolean hasNext()
        Specified by:
        hasNext in interface java.util.Iterator<java.util.List<Member>>
      • next

        public java.util.List<Member> next()
        Specified by:
        next in interface java.util.Iterator<java.util.List<Member>>
      • forward

        public boolean forward()
        Description copied from interface: TupleCursor
        Moves the iterator forward one position.

        Returns false only when end of data has been reached.

        Similar to calling the Iterator methods Iterator.hasNext() followed by Iterator.next() but does not construct an object, and is therefore cheaper.

        If you want to use an Iterator, see TupleIterator.

        Specified by:
        forward in interface TupleCursor
        Returns:
        Whether was able to move forward a position
      • current

        public java.util.List<Member> current()
        Description copied from interface: TupleCursor
        Returns the tuple that this cursor is positioned on.

        This method never returns null, and may safely be called multiple times (or not all) for each position in the iteration.

        Invalid to call this method when the cursor is has not been positioned, for example, if TupleCursor.forward() has not been called or if the most recent call to forward returned false.

        Specified by:
        current in interface TupleCursor
        Returns:
        Current tuple
      • currentToArray

        public void currentToArray​(Member[] members,
                                   int offset)
        Description copied from interface: TupleCursor
        Writes the member(s) of the next tuple to a given offset in an array.

        This method saves the overhead of a memory allocation when the resulting tuple will be written immediately to an array. The effect of currentToArray(members, 0) is the same as calling current().toArray(members).

        Before calling this method, you must position the iterator at a valid position. Typically you would call hasNext followed by next; or forward.

        Specified by:
        currentToArray in interface TupleCursor
        Parameters:
        members - Members
        offset - Offset in the array to write to
      • getArity

        public int getArity()
        Description copied from interface: TupleCursor
        Returns the number of members in each tuple.
        Specified by:
        getArity in interface TupleCursor
        Returns:
        The number of members in each tuple
      • remove

        public void remove()
        Specified by:
        remove in interface java.util.Iterator<java.util.List<Member>>