net.obsearch.index.ghs
Class FixedPriorityQueue<O extends Comparable<O>>

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


Constructor Summary
FixedPriorityQueue(int k)
           
 
Method Summary
 void add(O e)
           
 void addAll(O[] data)
           
 int compare(O o1, O o2)
           
 List<O> getSortedData()
           
 boolean isFull()
           
 Iterator<O> iterator()
           
 boolean offer(O e)
           
 O peek()
           
 O poll()
           
 int size()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

FixedPriorityQueue

public FixedPriorityQueue(int k)
Method Detail

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.