|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.egothor.util.QueueAbstract<T> org.egothor.util.Queue<T>
public abstract class Queue<T>
The Queue class should be extended by any class wishing to implement a priority queue (heap). The Queue object is used to aid in the merger of indices constructed for any number of document collections.
Field Summary | |
---|---|
T[] |
array
Used by the Queue to store objects. |
Fields inherited from class org.egothor.util.QueueAbstract |
---|
factor |
Constructor Summary | |
---|---|
Queue(int factor,
int max)
Constructor for the Queue object. |
|
Queue(int factor,
int init_size,
int delta)
Constructor for the Queue object |
Method Summary | |
---|---|
void |
append(T obj)
Add the given object to the end of the queue. |
int |
capacity()
Return the capacity of this Queue as defined in the constructor. |
void |
clear()
Description of the Method |
void |
cutOffLast()
Shrink the Queue by 1 (the last) position. |
void |
expand()
Description of the Method |
T |
item(int index)
Return the object at the given position in the Queue. |
void |
itemto(int index,
T obj)
Insert the given object in the Queue at the specified position. |
int |
lowestSonOf(int father)
Find an item with the lowest value amongst sons of a father. |
int |
size()
Return the number of elements in the queue. |
Methods inherited from class org.egothor.util.QueueAbstract |
---|
down, down, lessThan, peek, pop, push, replace, up |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public transient T[] array
Constructor Detail |
---|
public Queue(int factor, int max)
max
- the maximum size desired for the Queuepublic Queue(int factor, int init_size, int delta)
init_size
- Description of the Parameterdelta
- Description of the ParameterMethod Detail |
---|
public final void clear()
public final void expand()
expand
in class QueueAbstract<T>
public final int size()
size
in class QueueAbstract<T>
public final T item(int index)
item
in class QueueAbstract<T>
index
- the position of the desired object
public final int capacity()
capacity
in class QueueAbstract<T>
public final void itemto(int index, T obj)
itemto
in class QueueAbstract<T>
index
- the position at which to insertobj
- the object to insertpublic final int lowestSonOf(int father)
QueueAbstract
lowestSonOf
in class QueueAbstract<T>
public final void cutOffLast()
cutOffLast
in class QueueAbstract<T>
public final void append(T obj)
append
in class QueueAbstract<T>
obj
- the object to append
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |