public class SynchronizedList extends SynchronizedCollection implements java.util.List
List
to synchronize its behaviour
for a multi-threaded environment.
Methods are synchronized, then forwarded to the decorated list.
This class is Serializable from Commons Collections 3.1.
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
java.lang.Object object) |
boolean |
addAll(int index,
java.util.Collection coll) |
static java.util.List |
decorate(java.util.List list)
Factory method to create a synchronized list.
|
java.lang.Object |
get(int index) |
int |
indexOf(java.lang.Object object) |
int |
lastIndexOf(java.lang.Object object) |
java.util.ListIterator |
listIterator()
Iterators must be manually synchronized.
|
java.util.ListIterator |
listIterator(int index)
Iterators must be manually synchronized.
|
java.lang.Object |
remove(int index) |
java.lang.Object |
set(int index,
java.lang.Object object) |
java.util.List |
subList(int fromIndex,
int toIndex) |
add, addAll, clear, contains, containsAll, decorate, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString
public static java.util.List decorate(java.util.List list)
list
- the list to decorate, must not be nulljava.lang.IllegalArgumentException
- if list is nullpublic void add(int index, java.lang.Object object)
add
in interface java.util.List
public boolean addAll(int index, java.util.Collection coll)
addAll
in interface java.util.List
public java.lang.Object get(int index)
get
in interface java.util.List
public int indexOf(java.lang.Object object)
indexOf
in interface java.util.List
public int lastIndexOf(java.lang.Object object)
lastIndexOf
in interface java.util.List
public java.util.ListIterator listIterator()
synchronized (coll) { ListIterator it = coll.listIterator(); // do stuff with iterator }
listIterator
in interface java.util.List
public java.util.ListIterator listIterator(int index)
synchronized (coll) { ListIterator it = coll.listIterator(3); // do stuff with iterator }
listIterator
in interface java.util.List
public java.lang.Object remove(int index)
remove
in interface java.util.List
public java.lang.Object set(int index, java.lang.Object object)
set
in interface java.util.List
public java.util.List subList(int fromIndex, int toIndex)
subList
in interface java.util.List
Copyright © 2010 - 2020 Adobe. All Rights Reserved