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

public Class AbstractOrderedMapIteratorDecorator<K, V>

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

Provides basic behaviour for decorating an ordered 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 OrderedMapIterator<K, V>
iterator

The iterator being decorated

Constructor Summary

AccessConstructor and Description
public
AbstractOrderedMapIteratorDecorator(final OrderedMapIterator<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 OrderedMapIterator<K, V>

Returns:

the decorated iterator
getOrderedMapIterator
()

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, java.util.Iterator.hasNext.

Checks to see if there are more entries still to be iterated.
public boolean
hasPrevious()

Implements org.apache.commons.collections4.OrderedMapIterator.hasPrevious.

Checks to see if there is a previous entry that can be iterated to.
public K
public K
previous()

Implements org.apache.commons.collections4.OrderedMapIterator.previous.

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

Overrides default java.util.Iterator.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 OrderedMapIterator<K, V> iterator

The iterator being decorated

Constructor Detail

AbstractOrderedMapIteratorDecoratorback to summary
public AbstractOrderedMapIteratorDecorator(final OrderedMapIterator<K, V> iterator)

Constructor that decorates the specified iterator.

Parameters
iterator:OrderedMapIterator<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
getOrderedMapIteratorback to summary
protected OrderedMapIterator<K, V> getOrderedMapIterator()

Gets the iterator being decorated.

Returns:OrderedMapIterator<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, java.util.Iterator.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
hasPreviousback to summary
public boolean hasPrevious()

Implements org.apache.commons.collections4.OrderedMapIterator.hasPrevious.

Doc from org.apache.commons.collections4.OrderedMapIterator.hasPrevious.

Checks to see if there is a previous entry that can be iterated to.

Returns:boolean

true if the iterator has a previous element

Annotations
@Override
nextback to summary
public K next()

Implements org.apache.commons.collections4.MapIterator.next, java.util.Iterator.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
previousback to summary
public K previous()

Implements org.apache.commons.collections4.OrderedMapIterator.previous.

Doc from org.apache.commons.collections4.OrderedMapIterator.previous.

Gets the previous key from the Map.

Returns:K

the previous key in the iteration

Annotations
@Override
removeback to summary
public void remove()

Overrides default java.util.Iterator.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