E - The type of the items added into the list.public class SizeLimitedList<E>
extends java.lang.Object
Items are added at the front of the list. That is, the item at index 0 is more recent than that added at index 1. In this regard, this class resembles a stack.
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<E> |
backingList |
private int |
maxSize |
| Constructor and Description |
|---|
SizeLimitedList(int maxSize) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(E item) |
boolean |
contains(E item) |
E |
get(int index) |
int |
size() |
private final int maxSize
private final java.util.List<E> backingList