Package com.complexible.common.collect
Class TransformingLongIterator<T>
- java.lang.Object
-
- com.complexible.common.collect.TransformingLongIterator<T>
-
- All Implemented Interfaces:
PeekingLongIterator,SkippingLongIterator,CloseableLongIterator,LongIterator,java.lang.AutoCloseable
public abstract class TransformingLongIterator<T> extends java.lang.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
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()protected abstract longgetLong(T theValue)protected abstract TgetSkipTarget(long theValue)booleanhasNext()longnext()longpeek()voidreset()Resets the iterator to the beginning.booleanskipTo(long theValue)Moves the position to the minimal value that is greater than or equal to the target.
-
-
-
Constructor Detail
-
TransformingLongIterator
public TransformingLongIterator(SkippingIterator<T> theBaseIt, boolean theSkipValues)
-
-
Method Detail
-
getLong
protected abstract long getLong(T theValue)
-
getSkipTarget
protected abstract T getSkipTarget(long theValue)
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfaceLongIterator
-
next
public long next()
- Specified by:
nextin interfaceLongIterator
-
peek
public long peek()
- Specified by:
peekin interfacePeekingLongIterator
-
skipTo
public boolean skipTo(long theValue)
Description copied from interface:SkippingLongIteratorMoves 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:
skipToin interfaceSkippingLongIterator
-
reset
public void reset()
Description copied from interface:SkippingLongIteratorResets the iterator to the beginning.- Specified by:
resetin interfaceSkippingLongIterator
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceCloseableLongIterator- Specified by:
closein interfaceSkippingLongIterator
-
-