Package com.globalmentor.collections
Class SynchronizedListDecorator<E>
java.lang.Object
com.globalmentor.collections.SynchronizedCollectionDecorator<E>
com.globalmentor.collections.SynchronizedListDecorator<E>
- Type Parameters:
E
- The type of element contained in the list.
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
,List<E>
public class SynchronizedListDecorator<E>
extends SynchronizedCollectionDecorator<E>
implements List<E>
A list that wraps an existing list, providing access through the
List
interface. All collection access is synchronized on the provided
synchronization object.- Author:
- Garret Wilson
-
Field Summary
FieldsFields inherited from class com.globalmentor.collections.SynchronizedCollectionDecorator
collection, mutex
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
addAll
(int index, Collection<? extends E> c) get
(int index) int
int
listIterator
(int index) remove
(int index) void
replaceAll
(UnaryOperator<E> operator) void
sort
(Comparator<? super E> c) subList
(int fromIndex, int toIndex) Methods inherited from class com.globalmentor.collections.SynchronizedCollectionDecorator
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArray
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream
-
Field Details
-
list
The list this class decorates.
-
-
Constructor Details
-
SynchronizedListDecorator
List constructor.- Parameters:
list
- The list this list should decorate.mutex
- The mutual exclusion synchronization object.- Throws:
NullPointerException
- if the provided list and/or mutex isnull
.
-
-
Method Details
-
addAll
-
replaceAll
- Specified by:
replaceAll
in interfaceList<E>
-
sort
-
get
-
set
-
add
-
remove
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOf
in interfaceList<E>
-
listIterator
- Specified by:
listIterator
in interfaceList<E>
-
listIterator
- Specified by:
listIterator
in interfaceList<E>
-
subList
-