public class NullableCircularBuffer extends AbstractCollection implements org.apache.commons.collections.Buffer, org.apache.commons.collections.BoundedCollection, Serializable
| Constructor and Description |
|---|
NullableCircularBuffer()
Constructs a new
BoundedFifoBuffer big enough to hold 32
elements. |
NullableCircularBuffer(Collection coll)
Constructs a new
BoundedFifoBuffer big enough to hold all of
the elements in the specified collection. |
NullableCircularBuffer(int size)
Constructs a new
BoundedFifoBuffer big enough to hold the
specified number of elements. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Object element)
Adds the given element to this buffer.
|
void |
clear()
Clears this buffer.
|
Object |
get()
Returns the least recently inserted element in this buffer.
|
boolean |
isEmpty()
Returns true if this buffer is empty; false otherwise.
|
boolean |
isFull()
Returns true if this collection is full and no new elements can be added.
|
Iterator |
iterator()
Returns an iterator over this buffer's elements.
|
int |
maxSize()
Gets the maximum size of the collection (the bound).
|
Object |
remove()
Removes the least recently inserted element from this buffer.
|
int |
size()
Returns the number of elements stored in the buffer.
|
addAll, contains, containsAll, remove, removeAll, retainAll, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddAll, contains, containsAll, equals, hashCode, parallelStream, remove, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArraypublic NullableCircularBuffer()
BoundedFifoBuffer big enough to hold 32
elements.public NullableCircularBuffer(int size)
BoundedFifoBuffer big enough to hold the
specified number of elements.size - the maximum number of elements for this fifoIllegalArgumentException - if the size is less than 1public NullableCircularBuffer(Collection coll)
BoundedFifoBuffer big enough to hold all of
the elements in the specified collection. That collection's elements will
also be added to the buffer.coll - the collection whose elements to add, may not be nullNullPointerException - if the collection is nullpublic int size()
size in interface Collectionsize in class AbstractCollectionpublic boolean isEmpty()
isEmpty in interface CollectionisEmpty in class AbstractCollectionpublic boolean isFull()
isFull in interface org.apache.commons.collections.BoundedCollectiontrue if the collection is fullpublic int maxSize()
maxSize in interface org.apache.commons.collections.BoundedCollectionpublic void clear()
clear in interface Collectionclear in class AbstractCollectionpublic boolean add(Object element)
add in interface Collectionadd in class AbstractCollectionelement - the element to addpublic Object get()
get in interface org.apache.commons.collections.Bufferorg.apache.commons.collections.BufferUnderflowException - if the buffer is emptypublic Object remove()
remove in interface org.apache.commons.collections.Bufferorg.apache.commons.collections.BufferUnderflowException - if the buffer is emptypublic Iterator iterator()
iterator in interface Iterableiterator in interface Collectioniterator in class AbstractCollectionCopyright © 2014–2015 The Apache Software Foundation. All rights reserved.