public class CircularList<T> extends java.lang.Object implements IList<T>
Queue like behavior performs better than a plain ArrayList, since it automatically shift the contents of its internal Array only when really necessary.
Besides sparse allocations to increase the size of the internal Array, CircularList is allocation free (unlike the LinkedList family).
(c) Zynga 2012| Constructor and Description |
|---|
CircularList() |
CircularList(int pInitialCapacity) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int pIndex,
T pItem) |
void |
add(T pItem) |
void |
clear() |
T |
get(int pIndex) |
int |
indexOf(T pItem) |
boolean |
isEmpty() |
T |
remove(int pIndex) |
boolean |
remove(T pItem) |
T |
removeFirst() |
T |
removeLast() |
void |
set(int pIndex,
T pItem) |
int |
size() |
public CircularList()
public CircularList(int pInitialCapacity)
public T get(int pIndex) throws java.lang.ArrayIndexOutOfBoundsException
public void set(int pIndex,
T pItem)
throws java.lang.IndexOutOfBoundsException
public T removeFirst()
removeFirst in interface IList<T>public T removeLast()
removeLast in interface IList<T>