Package org.apache.sis.internal.util
Class AbstractMap.IteratorAdapter<K,V>
java.lang.Object
org.apache.sis.internal.util.AbstractMap.EntryIterator<K,V>
org.apache.sis.internal.util.AbstractMap.IteratorAdapter<K,V>
- Type Parameters:
K
- the type of keys maintained by the map.V
- the type of mapped values.
- Enclosing class:
AbstractMap<K,
V>
An implementation of
AbstractMap.EntryIterator
which delegates its work to a standard iterator.
Subclasses can modify the value
or other properties during iteration.
This method does not implement the AbstractMap.EntryIterator.remove()
method, thus assuming an unmodifiable map
(which is consistent with the default implementation of AbstractMap
methods).
Modifiable maps should override remove()
themselves.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionIteratorAdapter
(Map<K, V> map) Creates a new adapter initialized to the entry iterator of the given map. -
Method Summary
Modifier and TypeMethodDescriptionprotected K
getKey()
ReturnsMap.entry(K, V).getKey()}
.protected V
getValue()
Returnsvalue
, which was itself initialized toMap.entry(K, V).getValue()}
.protected boolean
next()
Moves to the next entry having a non-null value.Methods inherited from class org.apache.sis.internal.util.AbstractMap.EntryIterator
getEntry, remove
-
Field Details
-
it
The standard iterator on which to delegate the work. It is safe to change this value before to invokenext()
. -
entry
The entry found by the last call tonext()
. -
value
The value ofMap.entry(K, V).getValue()}
. It is safe to change this value afternext()
invocation.
-
-
Constructor Details
-
IteratorAdapter
Creates a new adapter initialized to the entry iterator of the given map.- Parameters:
map
- the map from which to return entries.
-
-
Method Details
-
next
protected boolean next()Moves to the next entry having a non-null value. If this method returnstrue
, then theMap.entry(K, V)
andvalue
fields are set to the properties of the new current entry. Otherwise (if this method returnsfalse
) theMap.entry(K, V)
andvalue
fields are undetermined.- Specified by:
next
in classAbstractMap.EntryIterator<K,
V> - Returns:
false
if this method reached iteration end.
-
getKey
ReturnsMap.entry(K, V).getKey()}
.- Specified by:
getKey
in classAbstractMap.EntryIterator<K,
V> - Returns:
- the key at the current iterator position.
-
getValue
Returnsvalue
, which was itself initialized toMap.entry(K, V).getValue()}
.- Specified by:
getValue
in classAbstractMap.EntryIterator<K,
V> - Returns:
- the value at the current iterator position.
-