org.omnaest.utils.structure.iterator
Class ThreadSafeIterator<E>
java.lang.Object
org.omnaest.utils.structure.iterator.ThreadSafeIterator<E>
- Type Parameters:
E -
- All Implemented Interfaces:
- Iterator<E>
public class ThreadSafeIterator<E>
- extends Object
- implements Iterator<E>
Thread safe Iterator delegate which makes use of an internal ReentrantLock to avoid concurrent access of the
underlying Iterator.
- Author:
- Omnaest
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ThreadSafeIterator
public ThreadSafeIterator(Iterator<E> iterator)
- Parameters:
iterator - - See Also:
ThreadSafeIterator
hasNext
public boolean hasNext()
- Specified by:
hasNext in interface Iterator<E>
next
public E next()
- Specified by:
next in interface Iterator<E>
remove
public void remove()
- Specified by:
remove in interface Iterator<E>
Copyright © 2013. All Rights Reserved.