Class ImmutableSortedMultiset.Builder<E>

    • Method Detail

      • add

        @CanIgnoreReturnValue
        public ImmutableSortedMultiset.Builder<Eadd​(E... elements)
        Adds each element of elements to the ImmutableSortedMultiset.
        Overrides:
        add in class ImmutableMultiset.Builder<E>
        Parameters:
        elements - the elements to add
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if elements is null or contains a null element
      • addCopies

        @CanIgnoreReturnValue
        public ImmutableSortedMultiset.Builder<EaddCopies​(E element,
                                                            int occurrences)
        Adds a number of occurrences of an element to this ImmutableSortedMultiset.
        Overrides:
        addCopies in class ImmutableMultiset.Builder<E>
        Parameters:
        element - the element to add
        occurrences - the number of occurrences of the element to add. May be zero, in which case no change will be made.
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if element is null
        java.lang.IllegalArgumentException - if occurrences is negative, or if this operation would result in more than Integer.MAX_VALUE occurrences of the element
      • setCount

        @CanIgnoreReturnValue
        public ImmutableSortedMultiset.Builder<EsetCount​(E element,
                                                           int count)
        Adds or removes the necessary occurrences of an element such that the element attains the desired count.
        Overrides:
        setCount in class ImmutableMultiset.Builder<E>
        Parameters:
        element - the element to add or remove occurrences of
        count - the desired count of the element in this multiset
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if element is null
        java.lang.IllegalArgumentException - if count is negative
      • addAll

        @CanIgnoreReturnValue
        public ImmutableSortedMultiset.Builder<EaddAll​(java.lang.Iterable<? extends E> elements)
        Adds each element of elements to the ImmutableSortedMultiset.
        Overrides:
        addAll in class ImmutableMultiset.Builder<E>
        Parameters:
        elements - the Iterable to add to the ImmutableSortedMultiset
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if elements is null or contains a null element
      • addAll

        @CanIgnoreReturnValue
        public ImmutableSortedMultiset.Builder<EaddAll​(java.util.Iterator<? extends E> elements)
        Adds each element of elements to the ImmutableSortedMultiset.
        Overrides:
        addAll in class ImmutableMultiset.Builder<E>
        Parameters:
        elements - the elements to add to the ImmutableSortedMultiset
        Returns:
        this Builder object
        Throws:
        java.lang.NullPointerException - if elements is null or contains a null element