Class TreeMultiset.AvlNode<E>

    • Constructor Detail

      • AvlNode

        AvlNode​(@Nullable
                E elem,
                int elemCount)
    • Method Detail

      • count

        public int count​(java.util.Comparator<? super E> comparator,
                         E e)
      • add

        TreeMultiset.AvlNode<E> add​(java.util.Comparator<? super E> comparator,
                                    @Nullable
                                    E e,
                                    int count,
                                    int[] result)
      • remove

        TreeMultiset.AvlNode<E> remove​(java.util.Comparator<? super E> comparator,
                                       @Nullable
                                       E e,
                                       int count,
                                       int[] result)
      • setCount

        TreeMultiset.AvlNode<E> setCount​(java.util.Comparator<? super E> comparator,
                                         @Nullable
                                         E e,
                                         int count,
                                         int[] result)
      • setCount

        TreeMultiset.AvlNode<E> setCount​(java.util.Comparator<? super E> comparator,
                                         @Nullable
                                         E e,
                                         int expectedCount,
                                         int newCount,
                                         int[] result)
      • recomputeMultiset

        private void recomputeMultiset()
      • recomputeHeight

        private void recomputeHeight()
      • recompute

        private void recompute()
      • balanceFactor

        private int balanceFactor()
      • ceiling

        @Nullable
        private TreeMultiset.AvlNode<E> ceiling​(java.util.Comparator<? super E> comparator,
                                                E e)
      • getElement

        public E getElement()
        Description copied from interface: Multiset.Entry
        Returns the multiset element corresponding to this entry. Multiple calls to this method always return the same instance.
        Returns:
        the element corresponding to this entry
      • getCount

        public int getCount()
        Description copied from interface: Multiset.Entry
        Returns the count of the associated element in the underlying multiset. This count may either be an unchanging snapshot of the count at the time the entry was retrieved, or a live view of the current count of the element in the multiset, depending on the implementation. Note that in the former case, this method can never return zero, while in the latter, it will return zero if all occurrences of the element were since removed from the multiset.
        Returns:
        the count of the element; never negative
      • toString

        public java.lang.String toString()
        Description copied from class: Multisets.AbstractEntry
        Returns a string representation of this multiset entry. The string representation consists of the associated element if the associated count is one, and otherwise the associated element followed by the characters " x " (space, x and space) followed by the count. Elements and counts are converted to strings as by String.valueOf.
        Specified by:
        toString in interface Multiset.Entry<E>
        Overrides:
        toString in class Multisets.AbstractEntry<E>