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 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.
-
-
-
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:
hasNext
in interfaceLongIterator
-
next
public long next()
- Specified by:
next
in interfaceLongIterator
-
peek
public long peek()
- Specified by:
peek
in interfacePeekingLongIterator
-
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 interfaceSkippingLongIterator
-
reset
public void reset()
Description copied from interface:SkippingLongIterator
Resets the iterator to the beginning.- Specified by:
reset
in interfaceSkippingLongIterator
-
close
public void close()
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfaceCloseableLongIterator
- Specified by:
close
in interfaceSkippingLongIterator
-
-