E
- generic typeto be used in this listpublic class WeakList<E>
extends java.util.AbstractList<E>
Constructor and Description |
---|
WeakList()
Create a weak random-access list.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
E element)
Inserts the object at the specified position in the list.
|
E |
get(int index) |
java.util.List<E> |
hardList() |
E |
remove(int index)
Removes the object at the specified position and returns it
or returns null if it was already collected.
|
E |
set(int index,
E element)
Sets the object at the specified position and returns the
previous object at that position or null if it was already
collected.
|
int |
size() |
void |
trimToSize()
Compacts the list by removing references to collected
objects.
|
add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
public E get(int index)
public int size()
public E set(int index, E element)
public void add(int index, E element)
public E remove(int index)
public java.util.List<E> hardList()
public void trimToSize()