Package com.google.common.collect
Class LinkedListMultimap.ValueForKeyIterator
- java.lang.Object
-
- com.google.common.collect.LinkedListMultimap.ValueForKeyIterator
-
- All Implemented Interfaces:
java.util.Iterator<V>
,java.util.ListIterator<V>
- Enclosing class:
- LinkedListMultimap<K,V>
private class LinkedListMultimap.ValueForKeyIterator extends java.lang.Object implements java.util.ListIterator<V>
AListIterator
over values for a specified key.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) LinkedListMultimap.Node<K,V>
current
(package private) java.lang.Object
key
(package private) LinkedListMultimap.Node<K,V>
next
(package private) int
nextIndex
(package private) LinkedListMultimap.Node<K,V>
previous
-
Constructor Summary
Constructors Constructor Description ValueForKeyIterator(java.lang.Object key)
Constructs a new iterator over all values for the specified key.ValueForKeyIterator(java.lang.Object key, int index)
Constructs a new iterator over all values for the specified key starting at the specified index.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(V value)
boolean
hasNext()
boolean
hasPrevious()
V
next()
int
nextIndex()
V
previous()
int
previousIndex()
void
remove()
void
set(V value)
-
-
-
Field Detail
-
key
final java.lang.Object key
-
nextIndex
int nextIndex
-
next
LinkedListMultimap.Node<K,V> next
-
current
LinkedListMultimap.Node<K,V> current
-
previous
LinkedListMultimap.Node<K,V> previous
-
-
Constructor Detail
-
ValueForKeyIterator
ValueForKeyIterator(@Nullable java.lang.Object key)
Constructs a new iterator over all values for the specified key.
-
ValueForKeyIterator
public ValueForKeyIterator(@Nullable java.lang.Object key, int index)
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:
java.lang.IndexOutOfBoundsException
- if index is invalid
-
-
Method Detail
-
hasNext
public boolean hasNext()
-
next
public V next()
-
hasPrevious
public boolean hasPrevious()
- Specified by:
hasPrevious
in interfacejava.util.ListIterator<V>
-
nextIndex
public int nextIndex()
- Specified by:
nextIndex
in interfacejava.util.ListIterator<V>
-
previousIndex
public int previousIndex()
- Specified by:
previousIndex
in interfacejava.util.ListIterator<V>
-
remove
public void remove()
-
-