|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.obsearch.AbstractOBPriorityQueue<O>
O
- Result object to be used by the queuepublic abstract class AbstractOBPriorityQueue<O extends AbstractOBResult<?>>
This class stores matching results. It is used to minimize the amount of distance computations required. To optimize a bit, the same priority queue is used to store results for the user
Field Summary | |
---|---|
protected int |
k
Maximum number of elements to be used. |
protected PriorityQueue<O> |
queue
The internal queue used to store results. |
Constructor Summary | |
---|---|
AbstractOBPriorityQueue()
Creates a priority queue of k = 3. |
|
AbstractOBPriorityQueue(int k)
Creates a priority queue by setting the maximum number of elements to be accepted. |
Method Summary | |
---|---|
boolean |
equals(Object obj)
Same "sort" of objects means that the distances of the included objects are the same, and the repetitions of such distances are the same. |
int |
getK()
|
int |
getSize()
|
List<O> |
getSortedElements()
|
boolean |
isFull()
Returns true if the queue is full. |
Iterator<O> |
iterator()
Returns an interator with all the elements in no particular order. |
O |
peek()
|
O |
poll()
|
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected PriorityQueue<O extends AbstractOBResult<?>> queue
protected int k
Constructor Detail |
---|
public AbstractOBPriorityQueue()
public AbstractOBPriorityQueue(int k)
k
- maximum number of elements to acceptMethod Detail |
---|
public final Iterator<O> iterator()
iterator
in interface Iterable<O extends AbstractOBResult<?>>
public final int getSize()
public O peek()
public final int getK()
public O poll()
public boolean isFull()
public final boolean equals(Object obj)
equals
in class Object
obj
- The AbstractOBPriorityQueue that will be compared.
public List<O> getSortedElements()
public final String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |