org.apache.mahout.cf.taste.common
Class MinK<T>

java.lang.Object
  extended by org.apache.mahout.cf.taste.common.MinK<T>

public class MinK<T>
extends Object

this class will preserve the k minimum elements of all elements it has been offered


Constructor Summary
MinK(int k, Comparator<? super T> comparator)
           
 
Method Summary
 T greatestSmall()
           
 boolean isEmpty()
           
 void offer(T item)
           
protected  T peek()
           
protected  Comparator<? super T> queueingComparator(Comparator<? super T> stdComparator)
           
 List<T> retrieve()
           
 int size()
           
protected  Comparator<? super T> sortingComparator(Comparator<? super T> stdComparator)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MinK

public MinK(int k,
            Comparator<? super T> comparator)
Method Detail

queueingComparator

protected Comparator<? super T> queueingComparator(Comparator<? super T> stdComparator)

sortingComparator

protected Comparator<? super T> sortingComparator(Comparator<? super T> stdComparator)

greatestSmall

public T greatestSmall()

offer

public void offer(T item)

isEmpty

public boolean isEmpty()

size

public int size()

retrieve

public List<T> retrieve()

peek

protected T peek()


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