Package com.complexible.common.collect

# Class TransformingLongIterator<T>

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

All Implemented Interfaces:
  `PeekingLongIterator`, `SkippingLongIterator`, `CloseableLongIterator`, `LongIterator`, `AutoCloseable`

public abstract class TransformingLongIterator<T> extends Object implements SkippingLongIterator
Transforms an object iterator to a long iterator.

Since:
  3.0.2
Author:
  Evren Sirin

- ## Field Summary

  ### Fields inherited from interface com.complexible.common.primitives.LongIterator

  `NO_NEXT_ELEMENT`

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

  `NOT_FOUND`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `TransformingLongIterator(SkippingIterator<T> theBaseIt, boolean theSkipValues)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `protected abstract long`
  `getLong(T theValue)`
  `protected abstract T`
  `getSkipTarget(long theValue)`
  `boolean`
  `hasNext()`
  `long`
  `next()`
  `long`
  `peek()`
  `void`
  `reset()`
  Resets the iterator to the beginning.
  `boolean`
  `skipTo(long theValue)`
  Moves the position to the minimal value that is greater than or equal to the target.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### TransformingLongIterator

    public TransformingLongIterator(SkippingIterator<T> theBaseIt, boolean theSkipValues)

- ## Method Details

  - ### getLong

    protected abstract long getLong(T theValue)

  - ### getSkipTarget

    protected abstract T getSkipTarget(long theValue)

  - ### hasNext

    public boolean hasNext()
    Specified by:
      `hasNext` in interface `LongIterator`

  - ### next

    public long next()
    Specified by:
      `next` in interface `LongIterator`

  - ### peek

    public long peek()
    Specified by:
      `peek` in interface `PeekingLongIterator`

  - ### skipTo

    public boolean skipTo(long theValue)
    Description copied from interface: `SkippingLongIterator`
    Moves the position to the minimal value that is greater than or equal to the target. Returns true, if such value exists, false otherwise.
    Specified by:
      `skipTo` in interface `SkippingLongIterator`

  - ### reset

    public void reset()
    Description copied from interface: `SkippingLongIterator`
    Resets the iterator to the beginning.
    Specified by:
      `reset` in interface `SkippingLongIterator`

  - ### close

    public void close()
    Specified by:
      `close` in interface `AutoCloseable`
    Specified by:
      `close` in interface `CloseableLongIterator`
    Specified by:
      `close` in interface `SkippingLongIterator`