public class Iterator<K,V> extends java.lang.Object implements ApiInterface
| Constructor and Description |
|---|
Iterator(Map<K,V> entries)
Creates an
Iterator over the entries of the given Map. |
Iterator(V[] entries)
Creates an
Iterator over the entries of the given Enumerator. |
| Modifier and Type | Method and Description |
|---|---|
Iterator<K,V> |
concat(Iterator<K,V> value)
Concatenates the given
Iterator to this one. |
K |
getKey()
Gets the key of the element at the current
Iterator position. |
Enumerator<K> |
getKeys()
Gets all keys of this
Iterator. |
V |
getValue()
Gets the value of the element at the current
Iterator position. |
Enumerator<V> |
getValues()
Gets all values of this
Iterator. |
boolean |
next()
Moves this
Iterator's position to the next element. |
public Iterator(V[] entries)
Iterator over the entries of the given Enumerator. The keys of the
iterator are consecutive integers from 0 up to the size of the Enumerator, i.e., the
indices of the entries. Thus, the Iterator's first type parameter should be treated
as an Integer.
I.e., Iterator<Integer, String> it = new Iterator(new Enumerator(new String[]{1, 2,
3})
entries - The elements to iterator over.public Iterator<K,V> concat(Iterator<K,V> value)
Iterator to this one.value - The Iterator to concatenate.Iterators.public boolean next()
Iterator's position to the next element.public K getKey()
Iterator position.public V getValue()
Iterator position.public Enumerator<K> getKeys()
Iterator.public Enumerator<V> getValues()
Iterator.