|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.ras.RASCircularQueue
RASCircularQueue is a circular queue for RAS events. When the queue fills, the next RAS event replaces the oldest event already in the queue.
RASIQueue
,
RASQueue
Field Summary | |
---|---|
static int |
DEFAULT_QUEUE_SIZE
The default queue size (10,000). |
Constructor Summary | |
---|---|
RASCircularQueue()
Creates a RASCircularQueue, whose size is defined by DEFAULT_QUEUE_SIZE. |
|
RASCircularQueue(int size)
Creates a RASCircularQueue. |
Method Summary | |
---|---|
java.lang.Object |
dequeue()
Removes an object from the beginning of the queue. |
void |
enqueue(java.lang.Object object)
Adds an object to the end of the queue. |
java.lang.Object |
firstObject()
Returns the first object on the queue, but does not remove it from the queue. |
int |
getMaximumQueueSize()
Gets the maximum number of objects which this queue will hold. |
int |
getQueueSize()
Gets the current number of objects in this queue. |
boolean |
isCircular()
Determines if the queue is circular. |
boolean |
isEmpty()
Determines if the queue is empty. |
boolean |
isFull()
Determines if the queue is full. |
void |
requeue(java.lang.Object object)
Returns an object to the front of the queue. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT_QUEUE_SIZE
Constructor Detail |
public RASCircularQueue()
public RASCircularQueue(int size) throws java.lang.IllegalArgumentException
size
- The number of objects that this queue can hold. If the
size is zero, the queue size is set to
DEFAULT_QUEUE_SIZE.java.lang.IllegalArgumentException
- This exception is thrown if the size parameter is less than zero.Method Detail |
public int getQueueSize()
getQueueSize
in interface RASIQueue
public int getMaximumQueueSize()
getMaximumQueueSize
in interface RASIQueue
public boolean isEmpty()
isEmpty
in interface RASIQueue
false
otherwise.public boolean isFull()
isFull
in interface RASIQueue
false
otherwise. (This queue always returns false.)public boolean isCircular()
isCircular
in interface RASIQueue
false
otherwise. (This queue always returns true.)public void enqueue(java.lang.Object object) throws RASQueueFullException
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) throws java.lang.IllegalStateException
requeue
in interface RASIQueue
object
- The object to be placed on the queue.java.lang.IllegalStateException
- This exception is always thrown because there is no way to reliably
add an object to the beginning of a circular queue if objects
are added and removed via enqueue and dequeue
.
See RASQueue.requeue
.public java.lang.Object firstObject() throws RASQueueEmptyException
firstObject
in interface RASIQueue
RASQueueEmptyException
- This exception is thrown if the queue is empty.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |