| Modifier and Type | Method and Description |
|---|---|
| public MutableBag | asSynchronized()
Redeclares org. Returns a synchronized wrapper backed by this collection. |
| public MutableBag | asUnmodifiable()
Redeclares org. Returns an unmodifiable view of this collection. |
| public <V> MutableBag | collect(Function<? super T, ? extends V> function)
Redeclares org. Returns a new collection with the results of applying the specified function on each element of the source collection. |
| public default MutableBooleanBag | collectBoolean(BooleanFunction<? super T> booleanFunction)
Overrides default org. Implements org. Returns a new primitive |
| public default MutableByteBag | collectByte(ByteFunction<? super T> byteFunction)
Overrides default org. Implements org. Returns a new primitive |
| public default MutableCharBag | collectChar(CharFunction<? super T> charFunction)
Overrides default org. Implements org. Returns a new primitive |
| public default MutableDoubleBag | collectDouble(DoubleFunction<? super T> doubleFunction)
Overrides default org. Implements org. Returns a new primitive |
| public default MutableFloatBag | collectFloat(FloatFunction<? super T> floatFunction)
Overrides default org. Implements org. Returns a new primitive |
| public <V> MutableBag | collectIf(Predicate<? super T> predicate, Function<? super T, ? extends V> function)
Redeclares org. Returns a new collection with the results of applying the specified function on each element of the source collection, but only for those elements which return true upon evaluation of the predicate. |
| public default MutableIntBag | collectInt(IntFunction<? super T> intFunction)
Overrides default org. Implements org. Returns a new primitive |
| public default MutableLongBag | collectLong(LongFunction<? super T> longFunction)
Overrides default org. Implements org. Returns a new primitive |
| public default MutableShortBag | collectShort(ShortFunction<? super T> shortFunction)
Overrides default org. Implements org. Returns a new primitive |
| public <P, V> MutableBag | collectWith(Function2<? super T, ? super P, ? extends V> function, P parameter)
Redeclares org. Same as |
| public <V> MutableBag | collectWithOccurrences(ObjectIntToObjectFunction<? super T, ? extends V> function)
Redeclares org. Iterates over the unique elements and their occurrences and collects the results of applying the specified function. |
| public default <V> MutableBag | countBy(Function<? super T, ? extends V> function)
Overrides default org. This method will count the number of occurrences of each value calculated by applying the function to each element of the collection. |
| public default <V> MutableBag | countByEach(Function<? super T, ? extends Iterable<V>> function)
Overrides default org. This method will count the number of occurrences of each value calculated by applying the function to each element of the collection. |
| public default <V, P> MutableBag | countByWith(Function2<? super T, ? super P, ? extends V> function, P parameter)
Overrides default org. 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. |
| public <V> MutableBag | flatCollect(Function<? super T, ? extends Iterable<V>> function)
Redeclares org.
|
| public default <P, V> MutableBag | flatCollectWith(Function2<? super T, ? super P, ? extends Iterable<V>> function, P parameter)
Overrides default org. Same as flatCollect, only with a Function2 that is passed an extra parameter. |
| public <V> MutableBagMultimap | groupBy(Function<? super T, ? extends V> function)
Redeclares org. For each element of the iterable, the function is evaluated and the results of these evaluations are collected into a new multimap, where the transformed value is the key and the original values are added to the same (or similar) species of collection as the source iterable. |
| public <V> MutableBagMultimap | groupByEach(Function<? super T, ? extends Iterable<V>> function)
Redeclares org. Similar to |
| public MutableBag | newEmpty()
Redeclares org. Creates a new empty mutable version of the same collection type. |
| public PartitionMutableBag | partition(Predicate<? super T> predicate)
Redeclares org. Filters a collection into a PartitionedIterable based on the evaluation of the predicate. |
| public <P> PartitionMutableBag | partitionWith(Predicate2<? super T, ? super P> predicate, P parameter)
Redeclares org. Filters a collection into a PartitionIterable based on the evaluation of the predicate. |
| public MutableBag | reject(Predicate<? super T> predicate)
Redeclares org. Returns all elements of the source collection that return false when evaluating of the predicate. |
| public <P> MutableBag | rejectWith(Predicate2<? super T, ? super P> predicate, P parameter)
Redeclares org. Similar to |
| public MutableBag | select(Predicate<? super T> predicate)
Redeclares org. Returns all elements of the source collection that return true when evaluating the predicate. |
| public MutableBag | selectByOccurrences(IntPredicate predicate)
Redeclares org. Returns all elements of the bag that have a number of occurrences that satisfy the predicate. |
| public default MutableBag | selectDuplicates()
Overrides default org. Returns all elements of the bag that have more than one occurrence. |
| public <S> MutableBag | selectInstancesOf(Class<S> clazz)
Redeclares org. Returns all elements of the source collection that are instances of the Class |
| public default MutableSet | selectUnique()
Implements org. Returns a set containing all elements of the bag that have exactly one occurrence. |
| public <P> MutableBag | selectWith(Predicate2<? super T, ? super P> predicate, P parameter)
Redeclares org. Similar to |
| public MutableBag | tap(Procedure<? super T> procedure)
Redeclares org. Executes the Procedure for each element in the iterable and returns |
| public ImmutableBag | toImmutable()
Redeclares org. Converts this |
| public default ImmutableBag | toImmutableBag()
Overrides default org. Converts the MutableBag to the default ImmutableBag implementation. |
| public MutableMap | toMapOfItemToCount()
Redeclares org. Converts the Bag to a Map of the Item type to its count as an Integer. |
| public default MutableBag | with(T element)
Overrides default org. This method allows mutable and fixed size collections the ability to add elements to their existing elements. |
| public default MutableBag | withAll(Iterable<? extends T> elements)
Overrides default org. This method allows mutable and fixed size collections the ability to add multiple elements to their existing elements. |
| public default MutableBag | withOccurrences(T element, int occurrences)
Overrides default org.
|
| public default MutableBag | without(T element)
Overrides default org. This method allows mutable and fixed size collections the ability to remove elements from their existing elements. |
| public default MutableBag | withoutAll(Iterable<? extends T> elements)
Overrides default org. This method allows mutable and fixed size collections the ability to remove multiple elements from their existing elements. |
| public default MutableBag | withoutOccurrences(T element, int occurrences)
Overrides default org.
|
| public <S> MutableBag | zip(Iterable<S> that)
Redeclares org.
Deprecated
in 6.0. Use
OrderedIterable#zip(Iterable) instead.
Returns a |
| public MutableSet | zipWithIndex()
Redeclares org.
Deprecated
in 6.0. Use
OrderedIterable#zipWithIndex() instead.
Zips this |