org.apache.mahout.common.iterator
Class SamplingIterable<T>
java.lang.Object
org.apache.mahout.common.iterator.SamplingIterable<T>
- All Implemented Interfaces:
- java.lang.Iterable<T>
public final class SamplingIterable<T>
- extends java.lang.Object
- implements java.lang.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.
Constructor Summary |
SamplingIterable(java.lang.Iterable<? extends T> delegate,
double samplingRate)
|
Method Summary |
java.util.Iterator<T> |
iterator()
|
static
<T> java.lang.Iterable<T> |
|
maybeWrapIterable(java.lang.Iterable<T> delegate,
double samplingRate)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SamplingIterable
public SamplingIterable(java.lang.Iterable<? extends T> delegate,
double samplingRate)
iterator
public java.util.Iterator<T> iterator()
- Specified by:
iterator
in interface java.lang.Iterable<T>
maybeWrapIterable
public static <T> java.lang.Iterable<T> maybeWrapIterable(java.lang.Iterable<T> delegate,
double samplingRate)
Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.