Class TreeValueSortedMap.ValueSortedTreeMapValues

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

    protected class TreeValueSortedMap.ValueSortedTreeMapValues
    extends java.util.AbstractCollection<V>
    implements SortedList<V>, java.util.Deque<V>
    A public view of the map as a list of values This view implements SortedList and Deque, since an ordered collection 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, V element)  
      boolean add​(V e)  
      boolean addAll​(int index, java.util.Collection<? extends V> c)  
      boolean addAll​(java.util.Collection<? extends V> c)  
      void addFirst​(V e)  
      void addLast​(V e)  
      int ceilingIndex​(V element)
      Returns the least index in this list whose element is greater than or equal to the specified element
      void clear()  
      boolean contains​(java.lang.Object o)  
      java.util.Iterator<V> descendingIterator()  
      V element()  
      int floorIndex​(V element)
      Returns the greatest index in this list whose element is less than or equal to the specified element
      V get​(int index)  
      V getFirst()  
      V getLast()  
      int higherIndex​(V element)
      Returns the least index in this list whose element is strictly greater the specified element
      int indexOf​(java.lang.Object o)  
      boolean isEmpty()  
      java.util.Iterator<V> iterator()  
      int lastIndexOf​(java.lang.Object o)  
      java.util.ListIterator<V> listIterator()  
      java.util.ListIterator<V> listIterator​(int index)  
      int lowerIndex​(V element)
      Returns the greatest index in this list whose element is strictly less than the specified element
      boolean offer​(V e)  
      boolean offerFirst​(V e)  
      boolean offerLast​(V e)  
      V peek()  
      V peekFirst()  
      V peekLast()  
      V poll()  
      V pollFirst()  
      V pollLast()  
      V pop()  
      void push​(V e)  
      V remove()  
      V remove​(int index)  
      boolean remove​(java.lang.Object o)  
      V removeFirst()  
      boolean removeFirstOccurrence​(java.lang.Object o)  
      V removeLast()  
      boolean removeLastOccurrence​(java.lang.Object o)  
      V set​(int index, V element)  
      int size()  
      java.util.List<V> subList​(int fromIndex, int toIndex)
      This operation is not supported
      • Methods inherited from class java.util.AbstractCollection

        containsAll, removeAll, retainAll, toArray, toArray, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, 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, spliterator, toArray, toArray
    • Method Detail

      • add

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        public int lowerIndex​(V element)
        Description copied from interface: SortedList
        Returns the greatest index in this list whose element is strictly less than the specified element
        Specified by:
        lowerIndex in interface SortedList<V>
        Parameters:
        element - the element to search for
        Returns:
        the index of the found element, or -1
      • floorIndex

        public int floorIndex​(V element)
        Description copied from interface: SortedList
        Returns the greatest index in this list whose element is less than or equal to the specified element

        If multiples of the specified element exist, this returns the least index of that element.

        Specified by:
        floorIndex in interface SortedList<V>
        Parameters:
        element - the element to search for
        Returns:
        the index of the found element, or -1
      • ceilingIndex

        public int ceilingIndex​(V element)
        Description copied from interface: SortedList
        Returns the least index in this list whose element is greater than or equal to the specified element

        If multiples of the specified element exist, this returns the greatest index of that element.

        Specified by:
        ceilingIndex in interface SortedList<V>
        Parameters:
        element - the element to search for
        Returns:
        the index of the found element, or -1
      • higherIndex

        public int higherIndex​(V element)
        Description copied from interface: SortedList
        Returns the least index in this list whose element is strictly greater the specified element
        Specified by:
        higherIndex in interface SortedList<V>
        Parameters:
        element - the element to search for
        Returns:
        the index of the found element, or -1
      • isEmpty

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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