public class CircularArrayBuffer<E> extends java.util.AbstractList<E> implements CircularBuffer<E>, java.lang.Cloneable, java.util.RandomAccess, java.io.Serializable
| Modifier and Type | Class and Description |
|---|---|
protected static class |
CircularArrayBuffer.ListIteratorImpl<E> |
| Modifier and Type | Field and Description |
|---|---|
protected E[] |
array |
protected int |
capacity |
| Constructor and Description |
|---|
CircularArrayBuffer(int capacity) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E e) |
boolean |
addAll(java.util.Collection<? extends E> elements) |
int |
capacity() |
void |
clear() |
int |
end() |
E |
get(int i) |
boolean |
isEmpty() |
java.util.Iterator<E> |
iterator() |
java.util.ListIterator<E> |
listIterator()
Not supported
|
java.util.ListIterator<E> |
listIterator(int i)
Not supported
|
int |
offset() |
E |
remove(int i)
Remove the element.
|
CircularArrayBuffer<E> |
removeFirst(int n)
Remove the elements from the beginning.
|
CircularArrayBuffer<E> |
removeLast(int n)
Remove the last elements
|
E |
set(int i,
E e)
Replace the element value
|
int |
size() |
java.util.List<E> |
subList(int fromIndex,
int toIndex)
Not supported
|
add, addAll, equals, hashCode, indexOf, lastIndexOf, removeRangecontains, containsAll, remove, removeAll, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitprotected final E[] array
protected final int capacity
public final int capacity()
capacity in interface CircularBuffer<E>public final int offset()
offset in interface CircularBuffer<E>public final int end()
end in interface CircularBuffer<E>public final int size()
public final boolean isEmpty()
public final void clear()
public final boolean add(E e)
public final boolean addAll(java.util.Collection<? extends E> elements)
public E get(int i)
get in interface CircularBuffer<E>get in interface java.util.List<E>get in class java.util.AbstractList<E>i - element indexpublic E set(int i, E e)
CircularBufferset in interface CircularBuffer<E>set in interface java.util.List<E>set in class java.util.AbstractList<E>i - element indexe - new element valuepublic final E remove(int i)
CircularBufferremove in interface CircularBuffer<E>remove in interface java.util.List<E>remove in class java.util.AbstractList<E>i - element indexpublic final CircularArrayBuffer<E> removeFirst(int n)
CircularBufferremoveFirst in interface CircularBuffer<E>n - the count of elements to removepublic final CircularArrayBuffer<E> removeLast(int n)
CircularBufferremoveLast in interface CircularBuffer<E>n - the count of elements to removepublic java.util.List<E> subList(int fromIndex, int toIndex)
CircularBuffersubList in interface CircularBuffer<E>subList in interface java.util.List<E>subList in class java.util.AbstractList<E>public java.util.Iterator<E> iterator()
iterator in interface CircularBuffer<E>iterator in interface java.lang.Iterable<E>iterator in interface java.util.Collection<E>iterator in interface java.util.List<E>iterator in class java.util.AbstractList<E>public java.util.ListIterator<E> listIterator()
CircularBufferlistIterator in interface CircularBuffer<E>listIterator in interface java.util.List<E>listIterator in class java.util.AbstractList<E>public java.util.ListIterator<E> listIterator(int i)
CircularBufferlistIterator in interface CircularBuffer<E>listIterator in interface java.util.List<E>listIterator in class java.util.AbstractList<E>