| |
|
| java.lang.Object com.lutris.util.CircularQueue
CircularQueue | public class CircularQueue (Code) | | |
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 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 | |
public | CircularQueue(int s) Creates a circular queue of size s (s objects). |
Method Summary | |
public Object | get() Removes an object from the queue. | public int | getCount() Returns the total number of objects stored in the queue. | public boolean | isEmpty() Checks to see if the queue is empty. | public boolean | put(Object x) Stores an object in the queue.
Parameters: x - The object to be stored in the queue. |
count | protected int count(Code) | | Number of objects currently stored in the queue.
|
qSize | protected int qSize(Code) | | The number of objects in the array (Queue size + 1).
|
queue | protected Object queue(Code) | | Array of references to the objects being queued.
|
rIndex | protected int rIndex(Code) | | The array index for the next object to be removed from the queue.
|
sIndex | protected int sIndex(Code) | | The array index for the next object to be stored in the queue.
|
CircularQueue | public CircularQueue(int s)(Code) | | Creates a circular queue of size s (s objects).
Parameters: s - The maximum number of elements to be queued. |
getCount | public int getCount()(Code) | | Returns the total number of objects stored in the queue.
The total number of objects in the queue. |
isEmpty | public boolean isEmpty()(Code) | | Checks to see if the queue is empty.
true if queue is empty, false otherwise. |
|
|
|