public class CyclicBufferList extends AbstractList implements List
modCount| Constructor and Description |
|---|
CyclicBufferList() |
CyclicBufferList(int maxSize)
Instantiate a new CyclicBuffer of at most
maxSize events. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Object event)
Add an
event as the last event in the buffer. |
void |
clear() |
Object |
get()
Get the oldest (first) element in the buffer.
|
Object |
get(int i)
Get the ith oldest event currently in the buffer.
|
int |
getLast() |
int |
getMaxSize() |
Object |
remove(int index)
Removes the element at the specified position in this list.
|
void |
resize(int newSize)
Resize the cyclic buffer to
newSize. |
Object |
set(int index,
Object element) |
int |
size()
Get the number of elements in the buffer.
|
add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subListaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, addAll, addAll, contains, containsAll, equals, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, removeAll, replaceAll, retainAll, sort, spliterator, subList, toArray, toArrayparallelStream, removeIf, streampublic CyclicBufferList(int maxSize)
maxSize events.
The maxSize argument must a positive integer.maxSize - The maximum number of elements in the buffer.public CyclicBufferList()
public Object remove(int index)
remove in interface Listremove in class AbstractListindex - the index of the element to removed.IndexOutOfBoundsException - if index out of range (index
< 0 || index >= size()).public Object set(int index, Object element)
set in interface Listset in class AbstractListpublic boolean add(Object event)
event as the last event in the buffer.add in interface Collectionadd in interface Listadd in class AbstractListpublic Object get(int i)
null is returned.get in interface Listget in class AbstractListpublic int getMaxSize()
public int getLast()
public Object get()
public int size()
maxSize
(inclusive).size in interface Collectionsize in interface Listsize in class AbstractCollectionpublic void resize(int newSize)
newSize.IllegalArgumentException - if newSize is negative.public void clear()
clear in interface Collectionclear in interface Listclear in class AbstractListCopyright © 2002-2018 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache Chainsaw, Chainsaw, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.