org.apache.mahout.common.iterator
Class SamplingIterator<T>
java.lang.Object
com.google.common.collect.UnmodifiableIterator<T>
com.google.common.collect.AbstractIterator<T>
org.apache.mahout.common.iterator.SamplingIterator<T>
- All Implemented Interfaces:
- Iterator<T>
public final class SamplingIterator<T>
- extends com.google.common.collect.AbstractIterator<T>
Wraps an Iterator
and returns only some subset of the elements that it would, as determined by a
iterator rate parameter.
Methods inherited from class com.google.common.collect.AbstractIterator |
endOfData, hasNext, next, peek |
Methods inherited from class com.google.common.collect.UnmodifiableIterator |
remove |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SamplingIterator
public SamplingIterator(Iterator<? extends T> delegate,
double samplingRate)
SamplingIterator
public SamplingIterator(RandomWrapper random,
Iterator<? extends T> delegate,
double samplingRate)
computeNext
protected T computeNext()
- Specified by:
computeNext
in class com.google.common.collect.AbstractIterator<T>
Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.