Package com.complexible.common.collect

# Class DelegatingSkippingIterator<T>

java.lang.Object
com.complexible.common.collect.DelegatingSkippingIterator<T>

All Implemented Interfaces:
  `CloseableIterator<T>`, `ResettableIterator<T>`, `SkippingIterator<T>`, `AutoCloseable`, `Iterator<T>`

public class DelegatingSkippingIterator<T> extends Object implements SkippingIterator<T>

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface com.complexible.common.base.CloseableIterator

  `CloseableIterator.AbstractCloseableIterator<T>, CloseableIterator.DelegatingCloseableIterator<T>, CloseableIterator.EmptyCloseableIterator<T>`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final SkippingIterator<T>`
  `it`

  ### Fields inherited from interface com.complexible.common.collect.SkippingIterator

  `UNKNOWN_SIZE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DelegatingSkippingIterator(SkippingIterator<T> it)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `Comparator<T>`
  `comparator()`
  Returns the comparator for this iterator that specifies the order in which the elements are returned.
  `long`
  `estimatedSize()`
  Returns the estimated size of this iterator without advancing the iterator or `SkippingIterator.UNKNOWN_SIZE` if the estimate is not known.
  `boolean`
  `hasNext()`
  `T`
  `next()`
  `void`
  `reset()`
  Resets the iterator to the beginning so the following `Iterator.next()` call will return the first element in this iteration.
  `boolean`
  `skipTo(T e)`
  Moves the iterators position to the next element which is greater than or equal to `theElement`.
  `boolean`
  `skipTo(T theElement, T theBound)`
  Same contract as `SkippingIterator.skipTo(Object)` but skipping is bounded: if the implementation can determine that the next element after target is greater than the bound, it can return false.

  ### 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, remove`

- ## Field Details

  - ### it

    protected final SkippingIterator<T> it

- ## Constructor Details

  - ### DelegatingSkippingIterator

    public DelegatingSkippingIterator(SkippingIterator<T> it)

- ## Method Details

  - ### reset

    public void reset()
    Description copied from interface: `ResettableIterator`
    Resets the iterator to the beginning so the following `Iterator.next()` call will return the first element in this iteration.
    Specified by:
      `reset` in interface `ResettableIterator<T>`

  - ### close

    public void close() throws RuntimeException
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `CloseableIterator<T>`
    Throws:
      `RuntimeException`

  - ### skipTo

    public boolean skipTo(T e)
    Description copied from interface: `SkippingIterator`
    Moves the iterators position to the next element which is greater than or equal to `theElement`.
    Specified by:
      `skipTo` in interface `SkippingIterator<T>`
    Returns:
      true, if such an element exists (in which case the `Iterator.next()` call will return it), false otherwise

  - ### skipTo

    public boolean skipTo(T theElement, T theBound)
    Description copied from interface: `SkippingIterator`
    Same contract as `SkippingIterator.skipTo(Object)` but skipping is bounded: if the implementation can determine that the next element after target is greater than the bound, it can return false. In other words, if the method returns false, no element between the target (incl.) and the bound (incl.) exists. If the method returns true, the next element is definitely greater or equal than the target, but may exceed the bound. If the method returns false, there's no guarantee on the state of the iterator. If it needs to be reused, it must be first reset.
    Specified by:
      `skipTo` in interface `SkippingIterator<T>`
    Parameters:
      `theElement` - the target
      `theBound` - the bound. null means no upper bound.
    Returns:
      true, if an element that is greater than or equal to `theElement` but less than or equal to `theBound` exists.

  - ### comparator

    public Comparator<T> comparator()
    Description copied from interface: `SkippingIterator`
    Returns the comparator for this iterator that specifies the order in which the elements are returned.
    Specified by:
      `comparator` in interface `SkippingIterator<T>`

  - ### estimatedSize

    public long estimatedSize()
    Description copied from interface: `SkippingIterator`
    Returns the estimated size of this iterator without advancing the iterator or `SkippingIterator.UNKNOWN_SIZE` if the estimate is not known. The estimate is for the whole iterator and will not change after the iterator is advanced. There is no guarantee about the accuracy of the estimate.
    Specified by:
      `estimatedSize` in interface `SkippingIterator<T>`

  - ### hasNext

    public boolean hasNext()
    Specified by:
      `hasNext` in interface `Iterator<T>`

  - ### next

    public T next()
    Specified by:
      `next` in interface `Iterator<T>`