Module org.arakhne.afc.core.util
Package org.arakhne.afc.sizediterator
Class UnmodifiableMapValueSizedIterator<V>
- java.lang.Object
-
- org.arakhne.afc.sizediterator.UnmodifiableMapValueSizedIterator<V>
-
- Type Parameters:
V
- is the type of values.
- All Implemented Interfaces:
Iterator<V>
,SizedIterator<V>
public class UnmodifiableMapValueSizedIterator<V> extends Object implements SizedIterator<V>
Class that map the values of a Map to an unmodifiable sized iterator.A sized iterator is an Iterator that is able to reply the size of the iterated collection and the number of elements that may be encountered in the next iterations.
This class provides features closed to
Collections.unmodifiableMap(Map)
but with a sized iterators on the values of the map. To obtain similar features on the map keys, seeUnmodifiableMapKeySizedIterator
.This iterator disables the use of the function
Iterator.remove()
.- Version:
- 17.0 2020-01-04 14:41:38
- Author:
- Stéphane GALLAND
- See Also:
UnmodifiableMapKeySizedIterator
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- util
-
-
Constructor Summary
Constructors Constructor Description UnmodifiableMapValueSizedIterator(Map<?,V> map)
Construct an iterator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
hasNext()
int
index()
Replies the position of the last replied element in the iterated collection.V
next()
int
rest()
Replies the count of elements which are not replied by the iterator.int
totalSize()
Replies the count of elements in the iterated collection.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining, remove
-
-
-
-
Method Detail
-
rest
@Pure public int rest()
Description copied from interface:SizedIterator
Replies the count of elements which are not replied by the iterator.- Specified by:
rest
in interfaceSizedIterator<V>
- Returns:
- the count of elements which are not replied by the iterator.
-
index
@Pure public int index()
Description copied from interface:SizedIterator
Replies the position of the last replied element in the iterated collection.- Specified by:
index
in interfaceSizedIterator<V>
- Returns:
- the index of the last element replied by
next()
.
-
totalSize
@Pure public int totalSize()
Description copied from interface:SizedIterator
Replies the count of elements in the iterated collection.- Specified by:
totalSize
in interfaceSizedIterator<V>
- Returns:
- the count of elements in the iterated collection.
-
-