org.apache.commons.collections.iterators

Class UnmodifiableIterator

Implemented Interfaces:
Iterator, Unmodifiable

public final class UnmodifiableIterator
extends java.lang.Object
implements Iterator, Unmodifiable

Decorates an iterator such that it cannot be modified.
Version:
$Revision: 1.5 $ $Date: 2004/02/18 00:59:50 $
Author:
Stephen Colebourne
Since:
Commons Collections 3.0

Method Summary

static Iterator
decorate(Iterator iterator)
Decorates the specified iterator such that it cannot be modified.
boolean
hasNext()
Object
next()
void
remove()

Method Details

decorate

public static Iterator decorate(Iterator iterator)
Decorates the specified iterator such that it cannot be modified.

If the iterator is already unmodifiable it is returned directly.

Parameters:
iterator - the iterator to decorate

hasNext

public boolean hasNext()

next

public Object next()

remove

public void remove()

Copyright © 2001-2006 Apache Software Foundation. All Rights Reserved.