net.walend.collection
Class IndexedIteratorOfImmutable

java.lang.Object
  |
  +--net.walend.collection.IndexedIteratorOfImmutable
All Implemented Interfaces:
IndexedIterator, java.util.Iterator

public class IndexedIteratorOfImmutable
extends java.lang.Object
implements IndexedIterator

Use this class to wrap IndexedIterators when the Collection is Immutable.

Author:
David Walend dfw1@cornell.edu

Field Summary
private  IndexedIterator wrapped
           
 
Constructor Summary
IndexedIteratorOfImmutable(IndexedIterator it)
           
 
Method Summary
 boolean hasNext()
           
 int index()
           
 java.lang.Object next()
           
 void remove()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wrapped

private IndexedIterator wrapped
Constructor Detail

IndexedIteratorOfImmutable

public IndexedIteratorOfImmutable(IndexedIterator it)
Method Detail

hasNext

public boolean hasNext()
Specified by:
hasNext in interface java.util.Iterator

next

public java.lang.Object next()
Specified by:
next in interface java.util.Iterator

index

public int index()
Specified by:
index in interface IndexedIterator

remove

public void remove()
Specified by:
remove in interface java.util.Iterator
Throws:
java.lang.UnsupportedOperationException - because the underlying collection is immutable.


Copyright (c) 2001, 2002, David Walend