public final class SamplingLongPrimitiveIterator extends AbstractLongPrimitiveIterator
LongPrimitiveIterator
and returns only some subset of the elements that it would,
as determined by a sampling rate parameter.Constructor and Description |
---|
SamplingLongPrimitiveIterator(LongPrimitiveIterator delegate,
double samplingRate) |
SamplingLongPrimitiveIterator(RandomWrapper random,
LongPrimitiveIterator delegate,
double samplingRate) |
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext() |
static LongPrimitiveIterator |
maybeWrapIterator(LongPrimitiveIterator delegate,
double samplingRate) |
long |
nextLong() |
long |
peek() |
void |
remove() |
void |
skip(int n)
Skip the next n elements supplied by this
Iterator . |
next
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public SamplingLongPrimitiveIterator(LongPrimitiveIterator delegate, double samplingRate)
public SamplingLongPrimitiveIterator(RandomWrapper random, LongPrimitiveIterator delegate, double samplingRate)
public boolean hasNext()
public long nextLong()
long
in iterationpublic long peek()
long
in iteration without advancing iterationpublic void remove()
UnsupportedOperationException
public void skip(int n)
SkippingIterator
Iterator
. If there are less than n elements remaining,
this skips all remaining elements in the Iterator
. This method has the same effect as calling
Iterator.next()
n times, except that it will never throw NoSuchElementException
.public static LongPrimitiveIterator maybeWrapIterator(LongPrimitiveIterator delegate, double samplingRate)
Copyright © 2008–2017 The Apache Software Foundation. All rights reserved.