## org.apache.mahout.common.iterator
Class SamplingIterator<T>

    java.lang.Object
      org.apache.mahout.common.iterator.SamplingIterator<T>

All Implemented Interfaces:
  java.util.Iterator<T>

    public final class SamplingIterator<T>

extends java.lang.Object
implements java.util.Iterator<T>

Wraps an `Iterator` and returns only some subset of the elements that it would, as determined by a iterator rate parameter.

Constructor Summary
`SamplingIterator(java.util.Iterator<? extends T> delegate, double samplingRate)`

Method Summary
`boolean` `hasNext()`
`T` `next()`
`void` `remove()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SamplingIterator

    public SamplingIterator(java.util.Iterator<? extends T> delegate,
                            double samplingRate)

Method Detail

### hasNext

    public boolean hasNext()

  Specified by:
    `hasNext` in interface `java.util.Iterator<T>`

### next

    public T next()

  Specified by:
    `next` in interface `java.util.Iterator<T>`

### remove

    public void remove()

  Specified by:
    `remove` in interface `java.util.Iterator<T>`
  Throws:
    `java.lang.UnsupportedOperationException`

Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.