public class BlockingCircularQueue extends Object implements Serializable
Internal use only.
.A circular queue with blocking semantics.
Constructor and Description |
---|
BlockingCircularQueue()
Create the queue with a capacity of 20
|
BlockingCircularQueue(int capacity)
Create the queue with the specified capacity
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(Object object)
Add an object to the queue.
|
protected void |
assertNotNull(String fieldName,
Object fieldValue)
Verify that the specified value is not null.
|
void |
clear()
Remove all items from the queue
|
boolean |
isEmpty()
Return true if the collection is empty.
|
Object |
next()
Return the next item in the queue.
|
int |
size()
Return the number of objects currently in the collection.
|
String |
toString()
Return a string representation of this object.
|
public BlockingCircularQueue()
public BlockingCircularQueue(int capacity)
capacity
- The size of the queuepublic void clear()
public boolean add(Object object)
object
- The object to add.public Object next()
public int size()
public boolean isEmpty()
public String toString()
protected final void assertNotNull(String fieldName, Object fieldValue) throws DetailedNullPointerException
fieldName
- The name of the field to checkfieldValue
- The value of the field to checkDetailedNullPointerException
- If fieldValue is nullCopyright © 1998–2014 Gargoyle Software Inc.. All rights reserved.