Class AbstractBlockIntegerList.BILIterator

    • Constructor Summary

      Constructors 
      Constructor Description
      BILIterator​(int start_offset, int end_offset)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean hasNext()
      Returns true if this list iterator has more elements when traversing the list in the forward direction.
      boolean hasPrevious()
      Returns true if this list iterator has more elements when traversing the list in the reverse direction.
      int next()
      Returns the next element in the list.
      int previous()
      Returns the previous element in the list.
      void remove()
      Removes from the list the last element returned by the iterator.
      private void setupVars​(int pos)
      Sets up the internal variables given an offset.
      private void walkBack()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • start_offset

        private int start_offset
      • end_offset

        private int end_offset
      • current_block_size

        private int current_block_size
      • block_index

        private int block_index
      • block_offset

        private int block_offset
      • cur_offset

        private int cur_offset
    • Constructor Detail

      • BILIterator

        public BILIterator​(int start_offset,
                           int end_offset)
    • Method Detail

      • setupVars

        private void setupVars​(int pos)
        Sets up the internal variables given an offset.
      • hasNext

        public boolean hasNext()
        Description copied from interface: IntegerIterator
        Returns true if this list iterator has more elements when traversing the list in the forward direction. (In other words, returns true if next would return an element rather than throwing an exception.)
        Specified by:
        hasNext in interface IntegerIterator
      • next

        public int next()
        Description copied from interface: IntegerIterator
        Returns the next element in the list. This method may be called repeatedly to iterate through the list, or intermixed with calls to previous to go back and forth. (Note that alternating calls to next and previous will return the same element repeatedly.)
        Specified by:
        next in interface IntegerIterator
      • hasPrevious

        public boolean hasPrevious()
        Description copied from interface: IntegerIterator
        Returns true if this list iterator has more elements when traversing the list in the reverse direction. (In other words, returns true if previous would return an element rather than throwing an exception.)
        Specified by:
        hasPrevious in interface IntegerIterator
      • walkBack

        private void walkBack()
      • previous

        public int previous()
        Description copied from interface: IntegerIterator
        Returns the previous element in the list. This method may be called repeatedly to iterate through the list backwards, or intermixed with calls to next to go back and forth. (Note that alternating calls to next and previous will return the same element repeatedly.)
        Specified by:
        previous in interface IntegerIterator
      • remove

        public void remove()
        Description copied from interface: IntegerIterator
        Removes from the list the last element returned by the iterator. This method can be called only once per call to next. The behavior of an iterator is unspecified if the underlying collection is modified while the iteration is in progress in any way other than by calling this method.

        Some implementations of IntegerIterator may choose to not implement this method, in which case an appropriate exception is generated.

        Specified by:
        remove in interface IntegerIterator