|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjoeq.Allocator.CircularAddressQueue
public class CircularAddressQueue
An implementation of an address queue that uses a circular buffer.
| Field Summary | |
|---|---|
static int |
QUEUE_WORDS
Size of block (in words) to allocate when we need more space in a queue. |
static boolean |
TRACE
|
| Constructor Summary | |
|---|---|
CircularAddressQueue()
Create a new CircularAddressQueue. |
|
| Method Summary | |
|---|---|
void |
free()
Free the memory associated with this reference queue. |
void |
growQueue(int words)
Grows the queue to the specified size in words. |
Address |
peek()
Returns the first address from this queue, or null if the queue is empty. |
Address |
pull()
Returns and removes an address from this queue, or returns null if the queue is empty. |
void |
push(Address a)
Add the given address to the reference queue. |
int |
size()
Return the number of elements in this queue. |
int |
space()
Return the amount of free space (in words) in this queue. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final boolean TRACE
public static int QUEUE_WORDS
| Constructor Detail |
|---|
public CircularAddressQueue()
| Method Detail |
|---|
public void free()
AddressQueue
free in interface AddressQueuepublic void growQueue(int words)
AddressQueue
growQueue in interface AddressQueuepublic int size()
AddressQueue
size in interface AddressQueuepublic int space()
AddressQueue
space in interface AddressQueuepublic void push(Address a)
AddressQueue
push in interface AddressQueuea - address to addpublic Address pull()
AddressQueue
pull in interface AddressQueuepublic Address peek()
AddressQueue
peek in interface AddressQueue
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||