Class 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>
    A ListIterator over values for a specified key.
    • 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()
        Specified by:
        hasNext in interface java.util.Iterator<V>
        Specified by:
        hasNext in interface java.util.ListIterator<V>
      • next

        public V next()
        Specified by:
        next in interface java.util.Iterator<V>
        Specified by:
        next in interface java.util.ListIterator<V>
      • hasPrevious

        public boolean hasPrevious()
        Specified by:
        hasPrevious in interface java.util.ListIterator<V>
      • previous

        public V previous()
        Specified by:
        previous in interface java.util.ListIterator<V>
      • nextIndex

        public int nextIndex()
        Specified by:
        nextIndex in interface java.util.ListIterator<V>
      • previousIndex

        public int previousIndex()
        Specified by:
        previousIndex in interface java.util.ListIterator<V>
      • remove

        public void remove()
        Specified by:
        remove in interface java.util.Iterator<V>
        Specified by:
        remove in interface java.util.ListIterator<V>
      • set

        public void set​(V value)
        Specified by:
        set in interface java.util.ListIterator<V>
      • add

        public void add​(V value)
        Specified by:
        add in interface java.util.ListIterator<V>