Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Util.Collections
Class UnmodifiableIterator  view UnmodifiableIterator download UnmodifiableIterator.java

java.lang.Object
  extended byUtil.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 $

Constructor Summary
UnmodifiableIterator()
           
 
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
 

Constructor Detail

UnmodifiableIterator

public UnmodifiableIterator()
Method Detail

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