public class NumberSequenceIterator extends SplittableIterator<Long>
NumberSequenceIterator is an iterator that returns a sequence of numbers (as Long)s.
The iterator is splittable (as defined by SplittableIterator, i.e., it can be divided into multiple
iterators that each return a subsequence of the number sequence.| Constructor and Description |
|---|
NumberSequenceIterator(long from,
long to)
Internal constructor to allow for empty iterators.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getCurrent() |
int |
getMaximumNumberOfSplits() |
long |
getTo() |
boolean |
hasNext() |
Long |
next() |
void |
remove() |
NumberSequenceIterator[] |
split(int numPartitions) |
getSplitpublic NumberSequenceIterator(long from,
long to)
from - The first number returned by the iterator.to - The last number returned by the iterator.public long getCurrent()
public long getTo()
public boolean hasNext()
public Long next()
public void remove()
public NumberSequenceIterator[] split(int numPartitions)
split in class SplittableIterator<Long>public int getMaximumNumberOfSplits()
getMaximumNumberOfSplits in class SplittableIterator<Long>Copyright © 2014–2016 The Apache Software Foundation. All rights reserved.