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>AListIteratorover values for a specified key.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) LinkedListMultimap.Node<K,V>current(package private) java.lang.Objectkey(package private) LinkedListMultimap.Node<K,V>next(package private) intnextIndex(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 voidadd(V value)booleanhasNext()booleanhasPrevious()Vnext()intnextIndex()Vprevious()intpreviousIndex()voidremove()voidset(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(java.lang.Object key)
Constructs a new iterator over all values for the specified key.
-
ValueForKeyIterator
public ValueForKeyIterator(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:
hasPreviousin interfacejava.util.ListIterator<V>
-
nextIndex
public int nextIndex()
- Specified by:
nextIndexin interfacejava.util.ListIterator<V>
-
previousIndex
public int previousIndex()
- Specified by:
previousIndexin interfacejava.util.ListIterator<V>
-
remove
public void remove()
-
-