|
IcedTea-Web NetX |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
net.sourceforge.jnlp.util.WeakList<E>
public class WeakList<E>
This list stores objects automatically using weak references. Objects are added and removed from the list as normal, but may turn to null at any point (ie, indexOf(x) followed by get(x) may return null). The weak references are only removed when the trimToSize method is called so that the indices remain constant otherwise.
Field Summary |
---|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
WeakList()
Create a weak random-access list. |
Method Summary | |
---|---|
void |
add(int index,
E element)
Inserts the object at the specified position in the list. |
E |
get(int index)
Returns the object at the specified index, or null if the object has been collected. |
java.util.List<E> |
hardList()
Returns a list of hard references to the objects. |
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()
Returns the size of the list, including already collected objects. |
void |
trimToSize()
Compacts the list by removing references to collected objects. |
Methods inherited from class java.util.AbstractList |
---|
add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subList |
Methods inherited from class java.util.AbstractCollection |
---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
Constructor Detail |
---|
public WeakList()
Method Detail |
---|
public E get(int index)
get
in interface java.util.List<E>
get
in class java.util.AbstractList<E>
public int size()
size
in interface java.util.Collection<E>
size
in interface java.util.List<E>
size
in class java.util.AbstractCollection<E>
public E set(int index, E element)
set
in interface java.util.List<E>
set
in class java.util.AbstractList<E>
public void add(int index, E element)
add
in interface java.util.List<E>
add
in class java.util.AbstractList<E>
public E remove(int index)
remove
in interface java.util.List<E>
remove
in class java.util.AbstractList<E>
public java.util.List<E> hardList()
public void trimToSize()
|
IcedTea-Web NetX |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |