public class CollectionList<T>
extends java.util.AbstractSequentialList<T>
List
view of a Collection
, reflecting changes to the underlying Collection
. The list does
not implement RandomAccess
, and is best accessed in sequence. The list supports removal by object and add
at end operations, but not setting or indexed remove/add operations. These operations are supported only if
listIterator(int)
is overridden with a ListIterator
that supports add and set.
The default ListIterator
supports forward traversal only.Constructor and Description |
---|
CollectionList(java.util.Collection<T> collection) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(T t) |
boolean |
addAll(java.util.Collection<? extends T> c) |
void |
clear() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
boolean |
isEmpty() |
java.util.Iterator<T> |
iterator() |
int |
lastIndexOf(java.lang.Object o) |
java.util.ListIterator<T> |
listIterator(int index) |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
removeIf(java.util.function.Predicate<? super T> filter) |
boolean |
retainAll(java.util.Collection<?> c) |
int |
size() |
java.lang.Object[] |
toArray() |
<T1> T1[] |
toArray(T1[] a) |
equals, hashCode, indexOf, listIterator, removeRange, subList
public CollectionList(java.util.Collection<T> collection)
public int size()
public boolean isEmpty()
public java.util.Iterator<T> iterator()
public boolean contains(java.lang.Object o)
public java.lang.Object[] toArray()
public <T1> T1[] toArray(T1[] a)
public boolean add(T t)
public boolean remove(java.lang.Object o)
public boolean containsAll(java.util.Collection<?> c)
public boolean addAll(java.util.Collection<? extends T> c)
public boolean removeAll(java.util.Collection<?> c)
public boolean retainAll(java.util.Collection<?> c)
public boolean removeIf(java.util.function.Predicate<? super T> filter)
public void clear()
public int lastIndexOf(java.lang.Object o)