E - Element typepublic class CastingList<E> extends AbstractList<E> implements List<E>
If a member of the backing list is not an instanceof E, the
accessing method (such as List.get(int)) will throw a
ClassCastException.
All modifications are automatically written to the backing list. Not synchronized.
modCount| Modifier | Constructor and Description |
|---|---|
protected |
CastingList(List<? super E> list,
Class<E> clazz) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int pos,
E o) |
E |
get(int index) |
E |
remove(int index) |
E |
set(int index,
E element) |
int |
size() |
add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, removeRange, subListaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringCopyright © 2012–2015 The Apache Software Foundation. All rights reserved.