public class RASQueue extends java.lang.Object implements RASIQueue
RASQueue
is a buffer for RAS events. If the size of the
queue is set to zero, the queue is not limited in capacity (except
by the amount of memory installed in the computer). If the size is
greater than zero, the queue will hold the specified number of objects.RASIQueue
,
RASCircularQueue
Constructor and Description |
---|
RASQueue()
Deprecated.
Creates a
RASQueue , whose size is unbounded. |
RASQueue(int size)
Deprecated.
Creates a
RASQueue . |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
dequeue()
Deprecated.
Removes an object from the beginning of the queue.
|
void |
enqueue(java.lang.Object object)
Deprecated.
Adds an object to the end of the queue.
|
java.lang.Object |
firstObject()
Deprecated.
Returns the first object on the queue, but does not remove it from
the queue.
|
int |
getMaximumQueueSize()
Deprecated.
Gets the maximum number of objects which this queue will hold.
|
int |
getQueueSize()
Deprecated.
Gets the current number of objects in this queue.
|
boolean |
isCircular()
Deprecated.
Determines if the queue is circular.
|
boolean |
isEmpty()
Deprecated.
Determines if the queue is empty.
|
boolean |
isFull()
Deprecated.
Determines if the queue is full.
|
void |
requeue(java.lang.Object object)
Deprecated.
Returns an object to the front of the queue.
|
public RASQueue()
RASQueue
, whose size is unbounded.public RASQueue(int size) throws java.lang.IllegalArgumentException
RASQueue
.size
- The number of objects that can be held in this queue.java.lang.IllegalArgumentException
- This exception is thrown if the size parameter is less than zero.public int getQueueSize()
getQueueSize
in interface RASIQueue
public int getMaximumQueueSize()
getMaximumQueueSize
in interface RASIQueue
public boolean isEmpty()
public boolean isFull()
public boolean isCircular()
isCircular
in interface RASIQueue
true
if this queue is circular, or false
otherwise. This queue always returns false
.public void enqueue(java.lang.Object object) throws RASQueueFullException
null
, nothing is enqueued.enqueue
in interface RASIQueue
object
- The object to be placed on the queue.RASQueueFullException
- This exception is thrown if the queue is full.public java.lang.Object dequeue() throws RASQueueEmptyException
dequeue
in interface RASIQueue
RASQueueEmptyException
- This exception is thrown if the queue is empty.public void requeue(java.lang.Object object)
null
, nothing is enqueued.public java.lang.Object firstObject() throws RASQueueEmptyException
firstObject
in interface RASIQueue
RASQueueEmptyException
- This exception is thrown if the queue is empty.