Class TreeValueSortedMap.ValueSortedTreeMapEntrySet

  • All Implemented Interfaces:
    ValueSortedMap.ValueSortedMapEntryList<K,​V>, java.lang.Iterable<java.util.Map.Entry<K,​V>>, java.util.Collection<java.util.Map.Entry<K,​V>>, java.util.Deque<java.util.Map.Entry<K,​V>>, java.util.List<java.util.Map.Entry<K,​V>>, java.util.Queue<java.util.Map.Entry<K,​V>>, java.util.Set<java.util.Map.Entry<K,​V>>
    Enclosing class:
    TreeValueSortedMap<K,​V>

    protected class TreeValueSortedMap.ValueSortedTreeMapEntrySet
    extends java.util.AbstractSet<java.util.Map.Entry<K,​V>>
    implements ValueSortedMap.ValueSortedMapEntryList<K,​V>
    A public view of the map as a set of entries 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, all of the mutation methods are supported.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int index, java.util.Map.Entry<K,​V> element)
      Inserts (by copy) the entry into the owning map, ignoring index
      boolean add​(java.util.Map.Entry<K,​V> e)
      Inserts (by copy) the entry into the owning map
      boolean addAll​(int index, java.util.Collection<? extends java.util.Map.Entry<K,​V>> c)
      Inserts (by copy) all entries in the collection, ignoring index
      void addFirst​(java.util.Map.Entry<K,​V> e)
      Inserts (by copy) the entry at its sorted position, not necessarily first
      void addLast​(java.util.Map.Entry<K,​V> e)
      Inserts (by copy) the entry at its sorted position, not necessarily last
      void clear()  
      boolean contains​(java.lang.Object o)  
      java.util.Iterator<java.util.Map.Entry<K,​V>> descendingIterator()  
      java.util.Map.Entry<K,​V> element()  
      java.util.Map.Entry<K,​V> get​(int index)  
      java.util.Map.Entry<K,​V> getFirst()  
      java.util.Map.Entry<K,​V> getLast()  
      int indexOf​(java.lang.Object o)  
      boolean isEmpty()  
      java.util.Iterator<java.util.Map.Entry<K,​V>> iterator()  
      int lastIndexOf​(java.lang.Object o)  
      java.util.ListIterator<java.util.Map.Entry<K,​V>> listIterator()  
      java.util.ListIterator<java.util.Map.Entry<K,​V>> listIterator​(int index)  
      boolean offer​(java.util.Map.Entry<K,​V> e)  
      boolean offerFirst​(java.util.Map.Entry<K,​V> e)
      Inserts (by copy) the entry at its sorted position, not necessarily first
      boolean offerLast​(java.util.Map.Entry<K,​V> e)
      Inserts (by copy) the entry at its sorted position, not necessarily last
      java.util.Map.Entry<K,​V> peek()  
      java.util.Map.Entry<K,​V> peekFirst()  
      java.util.Map.Entry<K,​V> peekLast()  
      java.util.Map.Entry<K,​V> poll()  
      java.util.Map.Entry<K,​V> pollFirst()  
      java.util.Map.Entry<K,​V> pollLast()  
      java.util.Map.Entry<K,​V> pop()  
      void push​(java.util.Map.Entry<K,​V> e)  
      java.util.Map.Entry<K,​V> remove()  
      java.util.Map.Entry<K,​V> remove​(int index)  
      boolean remove​(java.lang.Object o)  
      java.util.Map.Entry<K,​V> removeFirst()  
      boolean removeFirstOccurrence​(java.lang.Object o)  
      java.util.Map.Entry<K,​V> removeLast()  
      boolean removeLastOccurrence​(java.lang.Object o)  
      java.util.Map.Entry<K,​V> set​(int index, java.util.Map.Entry<K,​V> element)
      Modify the entry (key and value) at index Because the map is sorted by value, the index of the given entry may not remain the same after it is modified.
      int size()  
      java.util.List<java.util.Map.Entry<K,​V>> 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

        addAll, 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.util.Deque

        addAll
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

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

        addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray
    • Method Detail

      • add

        public boolean add​(java.util.Map.Entry<K,​V> e)
        Inserts (by copy) the entry into the owning map
        Specified by:
        add in interface java.util.Collection<java.util.Map.Entry<K,​V>>
        Specified by:
        add in interface java.util.Deque<java.util.Map.Entry<K,​V>>
        Specified by:
        add in interface java.util.List<java.util.Map.Entry<K,​V>>
        Specified by:
        add in interface java.util.Queue<java.util.Map.Entry<K,​V>>
        Specified by:
        add in interface java.util.Set<java.util.Map.Entry<K,​V>>
        Overrides:
        add in class java.util.AbstractCollection<java.util.Map.Entry<K,​V>>
      • add

        public void add​(int index,
                        java.util.Map.Entry<K,​V> element)
        Inserts (by copy) the entry into the owning map, ignoring index
        Specified by:
        add in interface java.util.List<java.util.Map.Entry<K,​V>>
        Parameters:
        index - ignored since order is determined by the entry's value
      • addAll

        public boolean addAll​(int index,
                              java.util.Collection<? extends java.util.Map.Entry<K,​V>> c)
        Inserts (by copy) all entries in the collection, ignoring index
        Specified by:
        addAll in interface java.util.List<java.util.Map.Entry<K,​V>>
        Parameters:
        index - ignored since order is determined by the entries' values
      • addFirst

        public void addFirst​(java.util.Map.Entry<K,​V> e)
        Inserts (by copy) the entry at its sorted position, not necessarily first
        Specified by:
        addFirst in interface java.util.Deque<java.util.Map.Entry<K,​V>>
      • addLast

        public void addLast​(java.util.Map.Entry<K,​V> e)
        Inserts (by copy) the entry at its sorted position, not necessarily last
        Specified by:
        addLast in interface java.util.Deque<java.util.Map.Entry<K,​V>>
      • clear

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

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

        public java.util.Iterator<java.util.Map.Entry<K,​V>> descendingIterator()
        Specified by:
        descendingIterator in interface java.util.Deque<java.util.Map.Entry<K,​V>>
      • element

        public java.util.Map.Entry<K,​V> element()
        Specified by:
        element in interface java.util.Deque<java.util.Map.Entry<K,​V>>
        Specified by:
        element in interface java.util.Queue<java.util.Map.Entry<K,​V>>
      • get

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

        public java.util.Map.Entry<K,​V> getFirst()
        Specified by:
        getFirst in interface java.util.Deque<java.util.Map.Entry<K,​V>>
      • getLast

        public java.util.Map.Entry<K,​V> getLast()
        Specified by:
        getLast in interface java.util.Deque<java.util.Map.Entry<K,​V>>
      • indexOf

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

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

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

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

        public java.util.ListIterator<java.util.Map.Entry<K,​V>> listIterator()
        Specified by:
        listIterator in interface java.util.List<java.util.Map.Entry<K,​V>>
      • listIterator

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

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

        public boolean offerFirst​(java.util.Map.Entry<K,​V> e)
        Inserts (by copy) the entry at its sorted position, not necessarily first
        Specified by:
        offerFirst in interface java.util.Deque<java.util.Map.Entry<K,​V>>
      • offerLast

        public boolean offerLast​(java.util.Map.Entry<K,​V> e)
        Inserts (by copy) the entry at its sorted position, not necessarily last
        Specified by:
        offerLast in interface java.util.Deque<java.util.Map.Entry<K,​V>>
      • peek

        public java.util.Map.Entry<K,​V> peek()
        Specified by:
        peek in interface java.util.Deque<java.util.Map.Entry<K,​V>>
        Specified by:
        peek in interface java.util.Queue<java.util.Map.Entry<K,​V>>
      • peekFirst

        public java.util.Map.Entry<K,​V> peekFirst()
        Specified by:
        peekFirst in interface java.util.Deque<java.util.Map.Entry<K,​V>>
      • peekLast

        public java.util.Map.Entry<K,​V> peekLast()
        Specified by:
        peekLast in interface java.util.Deque<java.util.Map.Entry<K,​V>>
      • poll

        public java.util.Map.Entry<K,​V> poll()
        Specified by:
        poll in interface java.util.Deque<java.util.Map.Entry<K,​V>>
        Specified by:
        poll in interface java.util.Queue<java.util.Map.Entry<K,​V>>
      • pollFirst

        public java.util.Map.Entry<K,​V> pollFirst()
        Specified by:
        pollFirst in interface java.util.Deque<java.util.Map.Entry<K,​V>>
      • pollLast

        public java.util.Map.Entry<K,​V> pollLast()
        Specified by:
        pollLast in interface java.util.Deque<java.util.Map.Entry<K,​V>>
      • pop

        public java.util.Map.Entry<K,​V> pop()
        Specified by:
        pop in interface java.util.Deque<java.util.Map.Entry<K,​V>>
      • push

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

        public java.util.Map.Entry<K,​V> remove()
        Specified by:
        remove in interface java.util.Deque<java.util.Map.Entry<K,​V>>
        Specified by:
        remove in interface java.util.Queue<java.util.Map.Entry<K,​V>>
      • remove

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

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

        public java.util.Map.Entry<K,​V> removeFirst()
        Specified by:
        removeFirst in interface java.util.Deque<java.util.Map.Entry<K,​V>>
      • removeFirstOccurrence

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

        public java.util.Map.Entry<K,​V> removeLast()
        Specified by:
        removeLast in interface java.util.Deque<java.util.Map.Entry<K,​V>>
      • removeLastOccurrence

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

        public java.util.Map.Entry<K,​V> set​(int index,
                                                  java.util.Map.Entry<K,​V> element)
        Modify the entry (key and value) at index Because the map is sorted by value, the index of the given entry may not remain the same after it is modified. In fact, this is equivalent to removing the entry at the given index, and then inserting the given entry at its sorted position.
        Specified by:
        set in interface java.util.List<java.util.Map.Entry<K,​V>>
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection<java.util.Map.Entry<K,​V>>
        Specified by:
        size in interface java.util.Deque<java.util.Map.Entry<K,​V>>
        Specified by:
        size in interface java.util.List<java.util.Map.Entry<K,​V>>
        Specified by:
        size in interface java.util.Set<java.util.Map.Entry<K,​V>>
        Specified by:
        size in class java.util.AbstractCollection<java.util.Map.Entry<K,​V>>
      • subList

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