|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.obsearch.AbstractOBPriorityQueue<OBResultByte<O>>
net.obsearch.result.OBPriorityQueueByte<O>
public final class OBPriorityQueueByte<O>
This is a class used to efficiently perform k-nn searches. This queue is meant to be used with objects OBByte.
Field Summary |
---|
Fields inherited from class net.obsearch.AbstractOBPriorityQueue |
---|
k, queue |
Constructor Summary | |
---|---|
OBPriorityQueueByte(int k)
Create the priority queue with k elements. |
Method Summary | |
---|---|
boolean |
add(long id,
O obj,
byte distance)
Add the given object, object id and distance of type byte to the queue. |
void |
addMax(long id,
O obj,
byte distance)
Add the given object, object id and distance of type byte to the queue. |
boolean |
isCandidate(byte d)
Returns true if the given distance can be a candidate for adding it into the queue. |
byte |
updateRange(byte 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 OBPriorityQueueByte(int k)
Method Detail |
---|
public boolean add(long id, O obj, byte 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, byte 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 byte updateRange(byte r)
r
- The new range we want to calculate.
public boolean isCandidate(byte d)
d
- The lower resolution distance.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |