Package org.apache.flink.util
Class LongValueSequenceIterator
- java.lang.Object
-
- org.apache.flink.util.SplittableIterator<LongValue>
-
- org.apache.flink.util.LongValueSequenceIterator
-
- All Implemented Interfaces:
Serializable
,Iterator<LongValue>
@Public public class LongValueSequenceIterator extends SplittableIterator<LongValue>
TheLongValueSequenceIterator
is an iterator that returns a sequence of numbers (asLongValue
)s. The iterator is splittable (as defined bySplittableIterator
, i.e., it can be divided into multiple iterators that each return a subsequence of the number sequence.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LongValueSequenceIterator(long from, long to)
Creates a new splittable iterator, returning the range [from, to].
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description long
getCurrent()
int
getMaximumNumberOfSplits()
The maximum number of splits into which this iterator can be split up.long
getTo()
boolean
hasNext()
LongValue
next()
void
remove()
LongValueSequenceIterator[]
split(int numPartitions)
Splits this iterator into a number disjoint iterators.-
Methods inherited from class org.apache.flink.util.SplittableIterator
getSplit
-
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
-
-
-
-
Constructor Detail
-
LongValueSequenceIterator
public LongValueSequenceIterator(long from, long to)
Creates a new splittable iterator, returning the range [from, to]. Both boundaries of the interval are inclusive.- Parameters:
from
- The first number returned by the iterator.to
- The last number returned by the iterator.
-
-
Method Detail
-
getCurrent
public long getCurrent()
-
getTo
public long getTo()
-
hasNext
public boolean hasNext()
-
next
public LongValue next()
-
remove
public void remove()
-
split
public LongValueSequenceIterator[] split(int numPartitions)
Description copied from class:SplittableIterator
Splits this iterator into a number disjoint iterators. The union of these iterators returns the original iterator values.- Specified by:
split
in classSplittableIterator<LongValue>
- Parameters:
numPartitions
- The number of iterators to split into.- Returns:
- An array with the split iterators.
-
getMaximumNumberOfSplits
public int getMaximumNumberOfSplits()
Description copied from class:SplittableIterator
The maximum number of splits into which this iterator can be split up.- Specified by:
getMaximumNumberOfSplits
in classSplittableIterator<LongValue>
- Returns:
- The maximum number of splits into which this iterator can be split up.
-
-