|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.obsearch.AbstractOBPriorityQueue<OBResultLong<O>> net.obsearch.result.OBPriorityQueueLong<O>
public final class OBPriorityQueueLong<O>
This is a class used to efficiently perform k-nn searches. This queue is meant to be used with objects OBLong.
Field Summary |
---|
Fields inherited from class net.obsearch.AbstractOBPriorityQueue |
---|
k, queue |
Constructor Summary | |
---|---|
OBPriorityQueueLong(int k)
Create the priority queue with k elements. |
Method Summary | |
---|---|
boolean |
add(long id,
O obj,
long distance)
Add the given object, object id and distance of type long to the queue. |
void |
addMax(long id,
O obj,
long distance)
Add the given object, object id and distance of type long to the queue. |
boolean |
isCandidate(long d)
Returns true if the given distance can be a candidate for adding it into the queue. |
long |
updateRange(long r)
If queue.size() == k, then if the user's range is greater than the greatest element of the queue, we can reduce the range to the biggest element of the priority queue, that is its queue.peek() element. |
Methods inherited from class net.obsearch.AbstractOBPriorityQueue |
---|
equals, getK, getSize, getSortedElements, isFull, iterator, peek, poll, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public OBPriorityQueueLong(int k)
Method Detail |
---|
public boolean add(long id, O obj, long distance) throws InstantiationException, IllegalAccessException
id
- The id of the object to be usedobj
- The object to be addeddistance
- The distance to be added
IllegalAccessException
- If there is a problem when instantiating objects O
InstantiationException
- If there is a problem when instantiating objects Opublic void addMax(long id, O obj, long distance) throws InstantiationException, IllegalAccessException
id
- The id of the object to be usedobj
- The object to be addeddistance
- The distance to be added
IllegalAccessException
- If there is a problem when instantiating objects O
InstantiationException
- If there is a problem when instantiating objects Opublic long updateRange(long r)
r
- The new range we want to calculate.
public boolean isCandidate(long d)
d
- The lower resolution distance.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |