E
- the type of elements in this listpublic abstract class ProxiedList<E> extends ProxiedCollection<E> implements List<E>
List
implementation pointing to a given list object.
Therefore it allows implementing lists based on invisible list types, such as
Collections.unmodifiableList(List)
or
Collections.synchronizedList(List)
.
Modifier | Constructor and Description |
---|---|
protected |
ProxiedList(List<E> list)
An abstract
List implementation pointing to list . |
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
E element) |
boolean |
addAll(int index,
Collection<? extends E> collection) |
E |
get(int index) |
protected List<E> |
getWrappedForRead()
Returns the wrapped collection without verifying if modifying it is
prohibited.
|
protected List<E> |
getWrappedIfModifiable()
Verifies if this object is modifiable and either returns the wrapped
collection or throws an appropriate exception.
|
int |
indexOf(Object object) |
int |
lastIndexOf(Object object) |
ListIterator<E> |
listIterator() |
ListIterator<E> |
listIterator(int index) |
E |
remove(int index) |
E |
set(int index,
E element) |
List<E> |
subList(int fromIndex,
int toIndex) |
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, isModifiable, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, replaceAll, retainAll, size, sort, spliterator, toArray, toArray
parallelStream, removeIf, stream
protected ProxiedList(List<E> list)
List
implementation pointing to list
.
Therefore it allows implementing lists based on invisible list types, such as
Collections.unmodifiableList(List)
or
Collections.synchronizedList(List)
.
list
- the list to proxypublic boolean addAll(int index, @Nullable Collection<? extends E> collection)
protected List<E> getWrappedIfModifiable()
getWrappedIfModifiable
in class ProxiedCollection<E>
protected List<E> getWrappedForRead()
getWrappedForRead
in class ProxiedCollection<E>
public int lastIndexOf(@Nullable Object object)
lastIndexOf
in interface List<E>
public ListIterator<E> listIterator()
listIterator
in interface List<E>
public ListIterator<E> listIterator(int index)
listIterator
in interface List<E>
Copyright © 2025. All rights reserved.