|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mahout.cf.taste.impl.common.AbstractLongPrimitiveIterator
org.apache.mahout.cf.taste.impl.common.SamplingLongPrimitiveIterator
public final class SamplingLongPrimitiveIterator
Wraps an Iterator
and returns only some subset of the elements that it would, as determined by a
sampling rate parameter.
Constructor Summary | |
---|---|
SamplingLongPrimitiveIterator(LongPrimitiveIterator delegate,
double samplingRate)
|
Method Summary | |
---|---|
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 . |
Methods inherited from class org.apache.mahout.cf.taste.impl.common.AbstractLongPrimitiveIterator |
---|
next |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SamplingLongPrimitiveIterator(LongPrimitiveIterator delegate, double samplingRate)
Method Detail |
---|
public boolean hasNext()
public long nextLong()
long
in iterationpublic long peek()
long
in iteration without advancing iterationpublic void remove()
java.lang.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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |