Top Description Fields Constructors Methods
org.apache.commons.collections4.iterators

public Class AbstractMapIteratorDecorator<K, V>

extends Object
implements MapIterator<K, V>
Class Inheritance
All Implemented Interfaces
org.apache.commons.collections4.MapIterator, java.util.Iterator
Type Parameters
<K>
the type of keys
<V>
the type of mapped values
Imports
org.apache.commons.collections4.MapIterator

Provides basic behaviour for decorating a map iterator with extra functionality.

All methods are forwarded to the decorated map iterator.

Since
3.0

Field Summary

Modifier and TypeField and Description
private final MapIterator<K, V>
iterator

The iterator being decorated

Constructor Summary

AccessConstructor and Description
public
AbstractMapIteratorDecorator(final MapIterator<K, V>
the iterator to decorate, must not be null
iterator
)

Constructor that decorates the specified iterator.

Method Summary

Modifier and TypeMethod and Description
public K
getKey()

Implements org.apache.commons.collections4.MapIterator.getKey.

Gets the current key, which is the key returned by the last call to next().
protected MapIterator<K, V>

Returns:

the decorated iterator
getMapIterator
()

Gets the iterator being decorated.

public V
getValue()

Implements org.apache.commons.collections4.MapIterator.getValue.

Gets the current value, which is the value associated with the last key returned by next().
public boolean
hasNext()

Implements org.apache.commons.collections4.MapIterator.hasNext.

Checks to see if there are more entries still to be iterated.
public K
next()

Implements org.apache.commons.collections4.MapIterator.next.

Gets the next key from the Map.
public void
remove()

Implements org.apache.commons.collections4.MapIterator.remove.

Removes the last returned key from the underlying Map (optional operation).
public V
setValue(final V
the new value
obj
)

Implements org.apache.commons.collections4.MapIterator.setValue.

Sets the value associated with the current key (optional operation).
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

iteratorback to summary
private final MapIterator<K, V> iterator

The iterator being decorated

Constructor Detail

AbstractMapIteratorDecoratorback to summary
public AbstractMapIteratorDecorator(final MapIterator<K, V> iterator)

Constructor that decorates the specified iterator.

Parameters
iterator:MapIterator<K, V>

the iterator to decorate, must not be null

Exceptions
NullPointerException:
if the iterator is null

Method Detail

getKeyback to summary
public K getKey()

Implements org.apache.commons.collections4.MapIterator.getKey.

Doc from org.apache.commons.collections4.MapIterator.getKey.

Gets the current key, which is the key returned by the last call to next().

Returns:K

the current key

Annotations
@Override
getMapIteratorback to summary
protected MapIterator<K, V> getMapIterator()

Gets the iterator being decorated.

Returns:MapIterator<K, V>

the decorated iterator

getValueback to summary
public V getValue()

Implements org.apache.commons.collections4.MapIterator.getValue.

Doc from org.apache.commons.collections4.MapIterator.getValue.

Gets the current value, which is the value associated with the last key returned by next().

Returns:V

the current value

Annotations
@Override
hasNextback to summary
public boolean hasNext()

Implements org.apache.commons.collections4.MapIterator.hasNext.

Doc from org.apache.commons.collections4.MapIterator.hasNext.

Checks to see if there are more entries still to be iterated.

Returns:boolean

true if the iterator has more elements

Annotations
@Override
nextback to summary
public K next()

Implements org.apache.commons.collections4.MapIterator.next.

Doc from org.apache.commons.collections4.MapIterator.next.

Gets the next key from the Map.

Returns:K

the next key in the iteration

Annotations
@Override
removeback to summary
public void remove()

Implements org.apache.commons.collections4.MapIterator.remove.

Doc from org.apache.commons.collections4.MapIterator.remove.

Removes the last returned key from the underlying Map (optional operation).

This method can be called once per call to next().

Annotations
@Override
setValueback to summary
public V setValue(final V obj)

Implements org.apache.commons.collections4.MapIterator.setValue.

Doc from org.apache.commons.collections4.MapIterator.setValue.

Sets the value associated with the current key (optional operation).

Parameters
obj:V

the new value

Returns:V

the previous value

Annotations
@Override