Class ListMap.Keys

  • All Implemented Interfaces:
    java.lang.Iterable<K>, java.util.Collection<K>, java.util.Set<K>, java.util.SortedSet<K>
    Enclosing class:
    ListMap<K,​V>

    private class ListMap.Keys
    extends java.util.AbstractSet<K>
    implements java.util.SortedSet<K>
    Represents the key set of the enclosing map given by ListMap.keySet().

    Like base class AbstractSet, this class supports neither Set.add(Object) nor Set.addAll(Collection), i.e. those methods throw an UnsupportedOperationException. In contrast, this class supports methods Set.clear(), Set.remove(Object), Set.removeAll(Collection) and Set.retainAll(Collection). The iterator returned by iterator() supports Iterator.remove().

    See Also:
    ListMap.keysSet
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Keys()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void clear()
      Clears actually the enclosing ListMap delegating to ListMap.clear().
      java.util.Comparator<? super K> comparator()  
      boolean contains​(java.lang.Object obj)
      Returns actually whether obj is a key of the enclosing ListMap delegating to ListMap.containsKey(Object).
      K first()  
      java.util.SortedSet<K> headSet​(K toElement)  
      java.util.Iterator<K> iterator()
      Returns actually an instance of ListMap.KeysIterator.
      K last()  
      boolean remove​(java.lang.Object obj)
      Interpretes obj as key of the enclosing ListMap and removes the according key-value pair if present.
      int size()
      Returns actually the size of the enclosing ListMap delegating to ListMap.size().
      java.util.SortedSet<K> subSet​(K fromElement, K toElement)  
      java.util.SortedSet<K> tailSet​(K fromElement)  
      • Methods inherited from class java.util.AbstractSet

        equals, hashCode, removeAll
      • Methods inherited from class java.util.AbstractCollection

        add, addAll, containsAll, isEmpty, retainAll, toArray, toArray, toString
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.Set

        add, addAll, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArray
      • Methods inherited from interface java.util.SortedSet

        spliterator
    • Constructor Detail

      • Keys

        private Keys()
    • Method Detail

      • iterator

        public java.util.Iterator<K> iterator()
        Returns actually an instance of ListMap.KeysIterator.
        Specified by:
        iterator in interface java.util.Collection<K>
        Specified by:
        iterator in interface java.lang.Iterable<K>
        Specified by:
        iterator in interface java.util.Set<K>
        Specified by:
        iterator in class java.util.AbstractCollection<K>
      • size

        public int size()
        Returns actually the size of the enclosing ListMap delegating to ListMap.size().
        Specified by:
        size in interface java.util.Collection<K>
        Specified by:
        size in interface java.util.Set<K>
        Specified by:
        size in class java.util.AbstractCollection<K>
      • contains

        public boolean contains​(java.lang.Object obj)
        Returns actually whether obj is a key of the enclosing ListMap delegating to ListMap.containsKey(Object).
        Specified by:
        contains in interface java.util.Collection<K>
        Specified by:
        contains in interface java.util.Set<K>
        Overrides:
        contains in class java.util.AbstractCollection<K>
      • remove

        public boolean remove​(java.lang.Object obj)
        Interpretes obj as key of the enclosing ListMap and removes the according key-value pair if present. Returns whether the according key-value pair was present when invoking this method using ListMap.removeIdx(int).
        Specified by:
        remove in interface java.util.Collection<K>
        Specified by:
        remove in interface java.util.Set<K>
        Overrides:
        remove in class java.util.AbstractCollection<K>
      • clear

        public void clear()
        Clears actually the enclosing ListMap delegating to ListMap.clear().
        Specified by:
        clear in interface java.util.Collection<K>
        Specified by:
        clear in interface java.util.Set<K>
        Overrides:
        clear in class java.util.AbstractCollection<K>
      • comparator

        public java.util.Comparator<? super K> comparator()
        Specified by:
        comparator in interface java.util.SortedSet<K>
      • first

        public K first()
        Specified by:
        first in interface java.util.SortedSet<K>
      • last

        public K last()
        Specified by:
        last in interface java.util.SortedSet<K>
      • subSet

        public java.util.SortedSet<K> subSet​(K fromElement,
                                             K toElement)
        Specified by:
        subSet in interface java.util.SortedSet<K>
      • headSet

        public java.util.SortedSet<K> headSet​(K toElement)
        Specified by:
        headSet in interface java.util.SortedSet<K>
      • tailSet

        public java.util.SortedSet<K> tailSet​(K fromElement)
        Specified by:
        tailSet in interface java.util.SortedSet<K>