Package com.google.common.collect
Class LinkedListMultimap.ValueForKeyIterator
java.lang.Object
com.google.common.collect.LinkedListMultimap.ValueForKeyIterator
- All Implemented Interfaces:
Iterator<V>
,ListIterator<V>
- Enclosing class:
LinkedListMultimap<K,
V>
A
ListIterator
over values for a specified key.-
Field Summary
FieldsModifier and TypeFieldDescription(package private) LinkedListMultimap.Node
<K, V> (package private) final K
(package private) LinkedListMultimap.Node
<K, V> (package private) int
(package private) LinkedListMultimap.Node
<K, V> -
Constructor Summary
ConstructorsConstructorDescriptionValueForKeyIterator
(K key) Constructs a new iterator over all values for the specified key.ValueForKeyIterator
(K key, int index) Constructs a new iterator over all values for the specified key starting at the specified index. -
Method Summary
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
-
Field Details
-
key
-
nextIndex
int nextIndex -
next
-
current
-
previous
-
-
Constructor Details
-
ValueForKeyIterator
ValueForKeyIterator(K key) Constructs a new iterator over all values for the specified key. -
ValueForKeyIterator
Constructs a new iterator over all values for the specified key starting at the specified index. This constructor is optimized so that it starts at either the head or the tail, depending on which is closer to the specified index. This allows adds to the tail to be done in constant time.- Throws:
IndexOutOfBoundsException
- if index is invalid
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
hasPrevious
public boolean hasPrevious()- Specified by:
hasPrevious
in interfaceListIterator<V>
-
previous
- Specified by:
previous
in interfaceListIterator<V>
-
nextIndex
public int nextIndex()- Specified by:
nextIndex
in interfaceListIterator<V>
-
previousIndex
public int previousIndex()- Specified by:
previousIndex
in interfaceListIterator<V>
-
remove
public void remove() -
set
- Specified by:
set
in interfaceListIterator<V>
-
add
- Specified by:
add
in interfaceListIterator<V>
-