org.apache.commons.collections.iterators

Class UnmodifiableOrderedMapIterator

Implemented Interfaces:
Iterator, MapIterator, OrderedIterator, OrderedMapIterator, Unmodifiable

public final class UnmodifiableOrderedMapIterator
extends java.lang.Object
implements OrderedMapIterator, Unmodifiable

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

Method Summary

static OrderedMapIterator
decorate(OrderedMapIterator iterator)
Decorates the specified iterator such that it cannot be modified.
Object
getKey()
Object
getValue()
boolean
hasNext()
boolean
hasPrevious()
Checks to see if there is a previous entry that can be iterated to.
Object
next()
Object
previous()
Gets the previous key from the Map.
void
remove()
Object
setValue(Object value)

Method Details

decorate

public static OrderedMapIterator decorate(OrderedMapIterator iterator)
Decorates the specified iterator such that it cannot be modified.
Parameters:
iterator - the iterator to decorate

getKey

public Object getKey()
Specified by:
getKey in interface MapIterator

getValue

public Object getValue()
Specified by:
getValue in interface MapIterator

hasNext

public boolean hasNext()
Specified by:
hasNext in interface MapIterator

hasPrevious

public boolean hasPrevious()
Checks to see if there is a previous entry that can be iterated to.
Specified by:
hasPrevious in interface OrderedMapIterator
hasPrevious in interface OrderedIterator
Returns:
true if the iterator has a previous element

next

public Object next()
Specified by:
next in interface MapIterator

previous

public Object previous()
Gets the previous key from the Map.
Specified by:
previous in interface OrderedMapIterator
previous in interface OrderedIterator
Returns:
the previous key in the iteration

remove

public void remove()
Specified by:
remove in interface MapIterator

setValue

public Object setValue(Object value)
Specified by:
setValue in interface MapIterator

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