com.springsource.util.common
Class SynchronizedListIterator<T>
java.lang.Object
com.springsource.util.common.SynchronizedObject
com.springsource.util.common.SynchronizedIterator<T>
com.springsource.util.common.SynchronizedListIterator<T>
- Type Parameters:
T
- the type of the list elements
- All Implemented Interfaces:
- java.util.Iterator<T>, java.util.ListIterator<T>
public class SynchronizedListIterator<T>
- extends SynchronizedIterator<T>
- implements java.util.ListIterator<T>
SynchronizedListIterator
wraps a given ListIterator
and protects access to the iterator by
synchronizing on the monitor of the containing SynchronizedList
.
Concurrent Semantics
This class is thread safe, but ConcurrentModificationException may still be thrown.
- Since:
- jersey
- Author:
- Glyn Normington
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.ListIterator |
hasNext, next, remove |
monitor
private final java.lang.Object monitor
listIterator
private final java.util.ListIterator<T> listIterator
SynchronizedListIterator
public SynchronizedListIterator(java.util.ListIterator<T> listIterator,
java.lang.Object monitor)
add
public void add(T e)
-
- Specified by:
add
in interface java.util.ListIterator<T>
hasPrevious
public boolean hasPrevious()
-
- Specified by:
hasPrevious
in interface java.util.ListIterator<T>
nextIndex
public int nextIndex()
-
- Specified by:
nextIndex
in interface java.util.ListIterator<T>
previous
public T previous()
-
- Specified by:
previous
in interface java.util.ListIterator<T>
previousIndex
public int previousIndex()
-
- Specified by:
previousIndex
in interface java.util.ListIterator<T>
set
public void set(T e)
-
- Specified by:
set
in interface java.util.ListIterator<T>