net.obsearch.index.ghs
Class FixedPriorityQueue<O extends Comparable<O>>
java.lang.Object
net.obsearch.index.ghs.FixedPriorityQueue<O>
- Type Parameters:
O
-
- All Implemented Interfaces:
- Iterable<O>, Comparator<O>
public class FixedPriorityQueue<O extends Comparable<O>>
- extends Object
- implements Comparator<O>, Iterable<O>
Priority queue that stores the smallest k items from a sample set.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FixedPriorityQueue
public FixedPriorityQueue(int k)
add
public void add(O e)
isFull
public boolean isFull()
offer
public boolean offer(O e)
peek
public O peek()
poll
public O poll()
addAll
public void addAll(O[] data)
iterator
public Iterator<O> iterator()
- Specified by:
iterator
in interface Iterable<O extends Comparable<O>>
getSortedData
public List<O> getSortedData()
compare
public int compare(O o1,
O o2)
- Specified by:
compare
in interface Comparator<O extends Comparable<O>>
size
public int size()
Copyright © 2007-2011 Arnoldo Jose Muller Molina. All Rights Reserved.