org.apache.mahout.common.iterator
Class SamplingIterable<T>

java.lang.Object
  extended by 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.


Constructor Summary
SamplingIterable(Iterable<? extends T> delegate, double samplingRate)
           
 
Method Summary
 Iterator<T> iterator()
           
static
<T> Iterable<T>
maybeWrapIterable(Iterable<T> delegate, double samplingRate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SamplingIterable

public SamplingIterable(Iterable<? extends T> delegate,
                        double samplingRate)
Method Detail

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.