Class AbstractImmutableBagIterable<T>

    • Constructor Detail

      • AbstractImmutableBagIterable

        public AbstractImmutableBagIterable()
    • Method Detail

      • removeAllFrom

        protected void removeAllFrom​(java.lang.Iterable<? extends T> elements,
                                     MutableCollection<T> result)
      • add

        public boolean add​(T t)
        Specified by:
        add in interface java.util.Collection<T>
      • remove

        public boolean remove​(java.lang.Object o)
        Specified by:
        remove in interface java.util.Collection<T>
      • addAll

        public boolean addAll​(java.util.Collection<? extends T> collection)
        Specified by:
        addAll in interface java.util.Collection<T>
      • removeAll

        public boolean removeAll​(java.util.Collection<?> collection)
        Specified by:
        removeAll in interface java.util.Collection<T>
      • retainAll

        public boolean retainAll​(java.util.Collection<?> collection)
        Specified by:
        retainAll in interface java.util.Collection<T>
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection<T>
      • countBy

        public <V> ImmutableBag<V> countBy​(Function<? super T,​? extends V> function)
        Description copied from interface: RichIterable
        This method will count the number of occurrences of each value calculated by applying the function to each element of the collection.
        Specified by:
        countBy in interface ImmutableCollection<T>
        Specified by:
        countBy in interface RichIterable<T>
        Since:
        9.0
      • countByWith

        public <V,​P> ImmutableBag<V> countByWith​(Function2<? super T,​? super P,​? extends V> function,
                                                       P parameter)
        Description copied from interface: RichIterable
        This method will count the number of occurrences of each value calculated by applying the function to each element of the collection with the specified parameter as the second argument.
        Specified by:
        countByWith in interface ImmutableCollection<T>
        Specified by:
        countByWith in interface RichIterable<T>
        Since:
        9.0
      • stream

        public java.util.stream.Stream<T> stream()
        Specified by:
        stream in interface java.util.Collection<T>
        Specified by:
        stream in interface ImmutableCollection<T>
        Since:
        9.0
      • parallelStream

        public java.util.stream.Stream<T> parallelStream()
        Specified by:
        parallelStream in interface java.util.Collection<T>
        Specified by:
        parallelStream in interface ImmutableCollection<T>
        Since:
        9.0
      • spliterator

        public java.util.Spliterator<T> spliterator()
        Specified by:
        spliterator in interface java.util.Collection<T>
        Specified by:
        spliterator in interface ImmutableCollection<T>
        Specified by:
        spliterator in interface java.lang.Iterable<T>
        Since:
        9.0
      • shortCircuit

        protected boolean shortCircuit​(T[] elements,
                                       int[] occurrences,
                                       ObjectIntPredicate<? super T> predicate,
                                       boolean expected,
                                       boolean onShortCircuit,
                                       boolean atEnd)