|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.obsearch.index.ghs.FastPriorityQueueLong
public final class FastPriorityQueueLong
This data structure simulates a priority queue of objects sorted by their distance to some other object. It assumes several things for performance reasons: 1)Distances are discrete. 2) Objects to be stored are longs 3) The maximum distance value is a value m that is very small (64 for example :)). This priority queue uses a lot of memory if queueSize is too large.
| Constructor Summary | |
|---|---|
FastPriorityQueueLong(int maxDistance,
int queueSize)
Creates the queue |
|
| Method Summary | |
|---|---|
void |
add(long object,
int distance)
Add an object that is at a certain distance. |
long[] |
get()
Return the closest long objects We do not include the original distances to reduce the creation of objects. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FastPriorityQueueLong(int maxDistance,
int queueSize)
maxDistance - maximum distance that will be inserted in the queue. (from 0 to maxDistance)queueSize - size of the queue (number of closest elements to be obtained).| Method Detail |
|---|
public void add(long object,
int distance)
object - the object to adddistance - the distance of the object.public long[] get()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||