Class DynamicValueSortedTreeMap.ValueSortedTreeMapKeySet

  • All Implemented Interfaces:
    java.lang.Iterable<K>, java.util.Collection<K>, java.util.Deque<K>, java.util.List<K>, java.util.Queue<K>, java.util.Set<K>
    Enclosing class:
    DynamicValueSortedTreeMap<K,​V>

    public class DynamicValueSortedTreeMap.ValueSortedTreeMapKeySet
    extends java.util.AbstractSet<K>
    implements java.util.List<K>, java.util.Deque<K>
    A public view of the map as a set of keys In addition to Set, this view implements List and Deque, since an ordered set ought to behave like a list, and since this implementation is meant to be used as a dynamic-cost priority queue. Generally, only the removal mutation methods are supported, all others are not supported.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int index, K element)  
      boolean add​(K e)  
      boolean addAll​(int index, java.util.Collection<? extends K> c)  
      boolean addAll​(java.util.Collection<? extends K> c)  
      void addFirst​(K e)  
      void addLast​(K e)  
      void clear()  
      boolean contains​(java.lang.Object o)  
      java.util.Iterator<K> descendingIterator()  
      K element()  
      K get​(int index)  
      K getFirst()  
      K getLast()  
      int indexOf​(java.lang.Object o)  
      boolean isEmpty()  
      java.util.Iterator<K> iterator()  
      int lastIndexOf​(java.lang.Object o)  
      java.util.ListIterator<K> listIterator()  
      java.util.ListIterator<K> listIterator​(int index)  
      boolean offer​(K e)  
      boolean offerFirst​(K e)  
      boolean offerLast​(K e)  
      K peek()  
      K peekFirst()  
      K peekLast()  
      K poll()  
      K pollFirst()  
      K pollLast()  
      K pop()  
      void push​(K e)  
      K remove()  
      K remove​(int index)  
      boolean remove​(java.lang.Object o)  
      K removeFirst()  
      boolean removeFirstOccurrence​(java.lang.Object o)  
      K removeLast()  
      boolean removeLastOccurrence​(java.lang.Object o)  
      K set​(int index, K element)  
      int size()  
      java.util.Spliterator<K> spliterator()  
      java.util.List<K> subList​(int fromIndex, int toIndex)
      This operation is not supported
      • Methods inherited from class java.util.AbstractSet

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

        containsAll, 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.List

        containsAll, equals, hashCode, removeAll, replaceAll, retainAll, sort, toArray, toArray
      • Methods inherited from interface java.util.Set

        containsAll, retainAll, toArray, toArray
    • Method Detail

      • add

        public void add​(int index,
                        K element)
        Specified by:
        add in interface java.util.List<K>
      • add

        public boolean add​(K e)
        Specified by:
        add in interface java.util.Collection<K>
        Specified by:
        add in interface java.util.Deque<K>
        Specified by:
        add in interface java.util.List<K>
        Specified by:
        add in interface java.util.Queue<K>
        Specified by:
        add in interface java.util.Set<K>
        Overrides:
        add in class java.util.AbstractCollection<K>
      • addAll

        public boolean addAll​(java.util.Collection<? extends K> c)
        Specified by:
        addAll in interface java.util.Collection<K>
        Specified by:
        addAll in interface java.util.Deque<K>
        Specified by:
        addAll in interface java.util.List<K>
        Specified by:
        addAll in interface java.util.Set<K>
        Overrides:
        addAll in class java.util.AbstractCollection<K>
      • addAll

        public boolean addAll​(int index,
                              java.util.Collection<? extends K> c)
        Specified by:
        addAll in interface java.util.List<K>
      • addFirst

        public void addFirst​(K e)
        Specified by:
        addFirst in interface java.util.Deque<K>
      • addLast

        public void addLast​(K e)
        Specified by:
        addLast in interface java.util.Deque<K>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<K>
        Specified by:
        clear in interface java.util.List<K>
        Specified by:
        clear in interface java.util.Set<K>
        Overrides:
        clear in class java.util.AbstractCollection<K>
      • contains

        public boolean contains​(java.lang.Object o)
        Specified by:
        contains in interface java.util.Collection<K>
        Specified by:
        contains in interface java.util.Deque<K>
        Specified by:
        contains in interface java.util.List<K>
        Specified by:
        contains in interface java.util.Set<K>
        Overrides:
        contains in class java.util.AbstractCollection<K>
      • descendingIterator

        public java.util.Iterator<K> descendingIterator()
        Specified by:
        descendingIterator in interface java.util.Deque<K>
      • element

        public K element()
        Specified by:
        element in interface java.util.Deque<K>
        Specified by:
        element in interface java.util.Queue<K>
      • get

        public K get​(int index)
        Specified by:
        get in interface java.util.List<K>
      • getFirst

        public K getFirst()
        Specified by:
        getFirst in interface java.util.Deque<K>
      • getLast

        public K getLast()
        Specified by:
        getLast in interface java.util.Deque<K>
      • indexOf

        public int indexOf​(java.lang.Object o)
        Specified by:
        indexOf in interface java.util.List<K>
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection<K>
        Specified by:
        isEmpty in interface java.util.List<K>
        Specified by:
        isEmpty in interface java.util.Set<K>
        Overrides:
        isEmpty in class java.util.AbstractCollection<K>
      • iterator

        public java.util.Iterator<K> iterator()
        Specified by:
        iterator in interface java.util.Collection<K>
        Specified by:
        iterator in interface java.util.Deque<K>
        Specified by:
        iterator in interface java.lang.Iterable<K>
        Specified by:
        iterator in interface java.util.List<K>
        Specified by:
        iterator in interface java.util.Set<K>
        Specified by:
        iterator in class java.util.AbstractCollection<K>
      • lastIndexOf

        public int lastIndexOf​(java.lang.Object o)
        Specified by:
        lastIndexOf in interface java.util.List<K>
      • listIterator

        public java.util.ListIterator<K> listIterator()
        Specified by:
        listIterator in interface java.util.List<K>
      • listIterator

        public java.util.ListIterator<K> listIterator​(int index)
        Specified by:
        listIterator in interface java.util.List<K>
      • offer

        public boolean offer​(K e)
        Specified by:
        offer in interface java.util.Deque<K>
        Specified by:
        offer in interface java.util.Queue<K>
      • offerFirst

        public boolean offerFirst​(K e)
        Specified by:
        offerFirst in interface java.util.Deque<K>
      • offerLast

        public boolean offerLast​(K e)
        Specified by:
        offerLast in interface java.util.Deque<K>
      • peek

        public K peek()
        Specified by:
        peek in interface java.util.Deque<K>
        Specified by:
        peek in interface java.util.Queue<K>
      • peekFirst

        public K peekFirst()
        Specified by:
        peekFirst in interface java.util.Deque<K>
      • peekLast

        public K peekLast()
        Specified by:
        peekLast in interface java.util.Deque<K>
      • poll

        public K poll()
        Specified by:
        poll in interface java.util.Deque<K>
        Specified by:
        poll in interface java.util.Queue<K>
      • pollFirst

        public K pollFirst()
        Specified by:
        pollFirst in interface java.util.Deque<K>
      • pollLast

        public K pollLast()
        Specified by:
        pollLast in interface java.util.Deque<K>
      • pop

        public K pop()
        Specified by:
        pop in interface java.util.Deque<K>
      • push

        public void push​(K e)
        Specified by:
        push in interface java.util.Deque<K>
      • remove

        public K remove()
        Specified by:
        remove in interface java.util.Deque<K>
        Specified by:
        remove in interface java.util.Queue<K>
      • remove

        public K remove​(int index)
        Specified by:
        remove in interface java.util.List<K>
      • remove

        public boolean remove​(java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection<K>
        Specified by:
        remove in interface java.util.Deque<K>
        Specified by:
        remove in interface java.util.List<K>
        Specified by:
        remove in interface java.util.Set<K>
        Overrides:
        remove in class java.util.AbstractCollection<K>
      • removeFirst

        public K removeFirst()
        Specified by:
        removeFirst in interface java.util.Deque<K>
      • removeFirstOccurrence

        public boolean removeFirstOccurrence​(java.lang.Object o)
        Specified by:
        removeFirstOccurrence in interface java.util.Deque<K>
      • removeLast

        public K removeLast()
        Specified by:
        removeLast in interface java.util.Deque<K>
      • removeLastOccurrence

        public boolean removeLastOccurrence​(java.lang.Object o)
        Specified by:
        removeLastOccurrence in interface java.util.Deque<K>
      • set

        public K set​(int index,
                     K element)
        Specified by:
        set in interface java.util.List<K>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<K>
        Specified by:
        size in interface java.util.Deque<K>
        Specified by:
        size in interface java.util.List<K>
        Specified by:
        size in interface java.util.Set<K>
        Specified by:
        size in class java.util.AbstractCollection<K>
      • spliterator

        public java.util.Spliterator<K> spliterator()
        Specified by:
        spliterator in interface java.util.Collection<K>
        Specified by:
        spliterator in interface java.lang.Iterable<K>
        Specified by:
        spliterator in interface java.util.List<K>
        Specified by:
        spliterator in interface java.util.Set<K>
      • subList

        public java.util.List<K> subList​(int fromIndex,
                                         int toIndex)
        This operation is not supported
        Specified by:
        subList in interface java.util.List<K>