|
EAF 7.4 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lutris.util.CircularQueue
public class CircularQueue
Field Summary | |
---|---|
protected int |
count
Number of objects currently stored in the queue. |
protected int |
qSize
The number of objects in the array (Queue size + 1). |
protected java.lang.Object[] |
queue
Array of references to the objects being queued. |
protected int |
rIndex
The array index for the next object to be removed from the queue. |
protected int |
sIndex
The array index for the next object to be stored in the queue. |
Constructor Summary | |
---|---|
CircularQueue(int s)
Creates a circular queue of size s (s objects). |
Method Summary | |
---|---|
java.lang.Object |
get()
Removes an object from the queue. |
int |
getCount()
Returns the total number of objects stored in the queue. |
boolean |
isEmpty()
Checks to see if the queue is empty. |
boolean |
put(java.lang.Object x)
Stores an object in the queue. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.Object[] queue
protected int sIndex
protected int rIndex
protected int count
protected int qSize
Constructor Detail |
---|
public CircularQueue(int s)
s
- The maximum number of elements to be queued.Method Detail |
---|
public boolean put(java.lang.Object x) throws java.lang.ArrayIndexOutOfBoundsException
x
- The object to be stored in the queue.
java.lang.ArrayIndexOutOfBoundsException
public java.lang.Object get() throws java.lang.ArrayIndexOutOfBoundsException
java.lang.ArrayIndexOutOfBoundsException
public int getCount()
public boolean isEmpty()
|
EAF 7.4 Implementation | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |