Class SyncList
java.lang.Object
EDU.oswego.cs.dl.util.concurrent.SyncCollection
EDU.oswego.cs.dl.util.concurrent.SyncList
- All Implemented Interfaces:
Iterable, Collection, List, SequencedCollection
SyncLists wrap Sync-based control around java.util.Lists.
They support the following additional reader operations over
SyncCollection: hashCode, equals, get, indexOf, lastIndexOf,
subList. They support additional writer operations remove(int),
set(int), add(int), addAll(int). The corresponding listIterators
and are similarly extended.
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class SyncCollection
SyncCollection.SyncCollectionIterator -
Field Summary
Fields inherited from class SyncCollection
c_, rd_, syncFailures_, wr_ -
Constructor Summary
ConstructorsConstructorDescriptionSyncList(List list, ReadWriteLock rwl) Create a new SyncList protecting the given list, and using the given ReadWriteLock to control reader and writer methods.Create a new SyncList protecting the given collection, and using the given sync to control both reader and writer methods.Create a new SyncList protecting the given list, and using the given pair of locks to control reader and writer methods. -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanaddAll(int index, Collection coll) protected ListbaseList()booleanget(int index) inthashCode()intintlistIterator(int index) remove(int index) subList(int fromIndex, int toIndex) unprotectedListIterator(int index) Methods inherited from class SyncCollection
add, addAll, afterRead, beforeRead, clear, contains, containsAll, isEmpty, iterator, readerSync, remove, removeAll, retainAll, size, syncFailures, toArray, toArray, unprotectedIterator, writerSyncMethods inherited from class Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface List
add, addAll, addFirst, addLast, clear, contains, containsAll, getFirst, getLast, isEmpty, iterator, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, size, sort, spliterator, toArray, toArray
-
Constructor Details
-
SyncList
-
SyncList
Create a new SyncList protecting the given list, and using the given ReadWriteLock to control reader and writer methods. -
SyncList
-
-
Method Details
-
baseList
-
hashCode
-
equals
-
get
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList
-
subList
-
set
-
remove
-
add
-
addAll
-
unprotectedListIterator
-
listIterator
- Specified by:
listIteratorin interfaceList
-
unprotectedListIterator
-
listIterator
- Specified by:
listIteratorin interfaceList
-