Class DynamicValueSortedTreeMap.ValueSortedTreeMapEntrySet

  • All Implemented Interfaces:
    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:
    DynamicValueSortedTreeMap<K,​V>

    public class DynamicValueSortedTreeMap.ValueSortedTreeMapEntrySet
    extends java.util.AbstractSet<java.util.Map.Entry<K,​V>>
    implements java.util.List<java.util.Map.Entry<K,​V>>, java.util.Deque<java.util.Map.Entry<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 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 DynamicValueSortedTreeMap.Node 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>>
      • 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 DynamicValueSortedTreeMap.Node 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>>
      • poll

        public DynamicValueSortedTreeMap.Node 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>>
      • 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 DynamicValueSortedTreeMap.Node 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 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>>
      • removeFirstOccurrence

        public boolean removeFirstOccurrence​(java.lang.Object o)
        Specified by:
        removeFirstOccurrence 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 DynamicValueSortedTreeMap.Node 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>>
      • spliterator

        public java.util.Spliterator<java.util.Map.Entry<K,​V>> spliterator()
        Specified by:
        spliterator in interface java.util.Collection<java.util.Map.Entry<K,​V>>
        Specified by:
        spliterator in interface java.lang.Iterable<java.util.Map.Entry<K,​V>>
        Specified by:
        spliterator in interface java.util.List<java.util.Map.Entry<K,​V>>
        Specified by:
        spliterator in interface java.util.Set<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>>