com.basho.riak.client.util
Class UnmodifiableIterator<E>
java.lang.Object
com.basho.riak.client.util.UnmodifiableIterator<E>
- Type Parameters:
E
-
- All Implemented Interfaces:
- Iterator<E>
public class UnmodifiableIterator<E>
- extends Object
- implements Iterator<E>
Decorates an iterator so that remove throws UnsupportedOperationException
- Author:
- russell
Method Summary |
boolean |
hasNext()
|
E |
next()
|
void |
remove()
Always throws (as this is an UnmodifiableIterator). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UnmodifiableIterator
public UnmodifiableIterator(Iterator<E> delegate)
- Create a new
UnmodifiableIterator
for the given delegate
- Parameters:
delegate
- the iterator to decorate
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()
- Always throws (as this is an UnmodifiableIterator).
- Specified by:
remove
in interface Iterator<E>
- Throws:
UnsupportedOperationException
Copyright © 2012. All Rights Reserved.