org.apache.mahout.common.iterator
Class SamplingIterable<T>
java.lang.Object
org.apache.mahout.common.iterator.SamplingIterable<T>
- All Implemented Interfaces:
- Iterable<T>
public final class SamplingIterable<T>
- extends Object
- implements Iterable<T>
Wraps an Iterable
whose Iterable.iterator()
returns only some subset of the elements that
it would, as determined by a iterator rate parameter.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SamplingIterable
public SamplingIterable(Iterable<? extends T> delegate,
double samplingRate)
iterator
public Iterator<T> iterator()
- Specified by:
iterator
in interface Iterable<T>
maybeWrapIterable
public static <T> Iterable<T> maybeWrapIterable(Iterable<T> delegate,
double samplingRate)
Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.