java.lang.Object
Util.Collections.UnmodifiableIterator
- All Implemented Interfaces:
- java.util.Iterator
- Direct Known Subclasses:
- EnumerationIterator, FilterIterator, SimpleHashSet.ChainSet.Itr, SimpleHashSet.EntrySet.Itr
- public abstract class UnmodifiableIterator
- extends java.lang.Object
- implements java.util.Iterator
UnmodifiableIterator is an abstract superclass to save
you the trouble of implementing the remove() method
over and over again for those iterators which don't implement it.
The name's a bit clunky, but fits with the JDK naming in
java.util.Collections and etc.
- Version:
- $Id: UnmodifiableIterator.java,v 1.1 2003/03/05 08:26:27 joewhaley Exp $
|
Method Summary |
abstract boolean |
hasNext()
Returns true if the iteration has more elements. |
abstract java.lang.Object |
next()
Returns the next element in the iteration. |
void |
remove()
Always throws an UnsupportedOperationException. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UnmodifiableIterator
public UnmodifiableIterator()
hasNext
public abstract boolean hasNext()
- Returns
true if the iteration has more elements.
- Specified by:
hasNext in interface java.util.Iterator
next
public abstract java.lang.Object next()
- Returns the next element in the iteration.
- Specified by:
next in interface java.util.Iterator
remove
public final void remove()
- Always throws an
UnsupportedOperationException.
- Specified by:
remove in interface java.util.Iterator