| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private final int[] | |
| private final T[] | |
| pack-priv static final int | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | allSatisfy(Predicate<? super T> predicate)
Overrides org. Implements org. Returns true if the predicate evaluates to true for every element of the iterable or if the iterable is empty. |
| public <P> boolean | allSatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)
Overrides org. Implements org. Returns true if the predicate evaluates to true for every element of the collection, or returns false. |
| public boolean | allSatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)
Implements org. Returns true if the predicate evaluates to true for all elements of the Bag. |
| public boolean | anySatisfy(Predicate<? super T> predicate)
Overrides org. Implements org. Returns true if the predicate evaluates to true for any element of the iterable. |
| public <P> boolean | anySatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)
Overrides org. Implements org. Returns true if the predicate evaluates to true for any element of the collection, or return false. |
| public boolean | anySatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)
Implements org. Returns true if the predicate evaluates to true for any element of the Bag. |
| public <V> ImmutableBag | collect(Function<? super T, ? extends V> function)
Implements org. Returns a new collection with the results of applying the specified function on each element of the source collection. |
| public <V> ImmutableBag | collectIf(Predicate<? super T> predicate, Function<? super T, ? extends V> function)
Implements 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 static <T> ImmutableArrayBag | |
| public T | detect(Predicate<? super T> predicate)
Overrides org. Implements org. Returns the first element of the iterable for which the predicate evaluates to true or null in the case where no element returns true. |
| public Optional | detectOptional(Predicate<? super T> predicate)
Overrides org. Implements org. Returns the first element of the iterable for which the predicate evaluates to true as an Optional. |
| public <P> T | detectWith(Predicate2<? super T, ? super P> predicate, P parameter)
Overrides org. Implements org. Returns the first element that evaluates to true for the specified predicate2 and parameter, or null if none evaluate to true. |
| public T | detectWithOccurrences(ObjectIntPredicate<? super T> predicate)
Implements org. Returns an element of the Bag that satisfies the predicate or null if such an element does not exist |
| public <P> Optional | detectWithOptional(Predicate2<? super T, ? super P> predicate, P parameter)
Overrides org. Implements org. Returns the first element that evaluates to true for the specified predicate2 and parameter as an Optional. |
| public RichIterable | distinctView()
Overrides default org. Returns an unmodifiable view on the distinct elements with the same complexity as the Bag implementation. |
| public void | each(Procedure<? super T> procedure)
Implements org. The procedure is executed for each element in the iterable. |
| public boolean | equals(Object other)
Overrides java. Implements org. Two bags |
| public <V> ImmutableBag | flatCollect(Function<? super T, ? extends Iterable<V>> function)
Implements org.
|
| public void | forEachWithOccurrences(ObjectIntProcedure<? super T> objectIntProcedure)
Implements org. For each distinct item, with the number of occurrences, execute the specified procedure. |
| public T | getFirst()
Implements org. Returns the first element of an iterable. |
| public T | getLast()
Implements org. Returns the last element of an iterable. |
| public T | getOnly()
Overrides default org. Returns the element if the iterable has exactly one element. |
| public <V> ImmutableBagMultimap | groupBy(Function<? super T, ? extends V> function)
Implements 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> ImmutableBagMultimap | groupByEach(Function<? super T, ? extends Iterable<V>> function)
Implements org. Similar to |
| public int | hashCode()
Overrides java. Implements org. Returns the hash code for this Bag, defined as this. |
| public Iterator | iterator()
Implements java. Returns an iterator over elements of type |
| public T | max(Comparator<? super T> comparator)
Overrides org. Implements org. Returns the maximum element out of this container based on the comparator. |
| public T | max()
Overrides org. Implements org. Returns the maximum element out of this container based on the natural order. |
| public <V extends Comparable | maxBy(Function<? super T, ? extends V> function)
Overrides org. Implements org. Returns the maximum elements out of this container based on the natural order of the attribute returned by Function. |
| public T | min(Comparator<? super T> comparator)
Overrides org. Implements org. Returns the minimum element out of this container based on the comparator. |
| public T | min()
Overrides org. Implements org. Returns the minimum element out of this container based on the natural order. |
| public <V extends Comparable | minBy(Function<? super T, ? extends V> function)
Overrides org. Implements org. Returns the minimum elements out of this container based on the natural order of the attribute returned by Function. |
| private ImmutableBag | |
| public static <T> ImmutableArrayBag | |
| public ImmutableBag | newWith(T element)
Implements org. This method is similar to the |
| public ImmutableBag | newWithAll(Iterable<? extends T> elements)
Implements org. This method is similar to the |
| public ImmutableBag | newWithout(T element)
Implements org. This method is similar to the |
| public boolean | noneSatisfy(Predicate<? super T> predicate)
Overrides org. Implements org. Returns true if the predicate evaluates to false for every element of the iterable or if the iterable is empty. |
| public <P> boolean | noneSatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter)
Overrides org. Implements org. Returns true if the predicate evaluates to false for every element of the collection, or return false. |
| public boolean | noneSatisfyWithOccurrences(ObjectIntPredicate<? super T> predicate)
Implements org. Returns true if the Bag is empty or if the predicate evaluates to false for all elements of the Bag. |
| public int | occurrencesOf(Object item)
Implements org. The occurrences of a distinct item in the bag. |
| public ImmutableBag | reject(Predicate<? super T> predicate)
Implements org. Returns all elements of the source collection that return false when evaluating of the predicate. |
| public ImmutableBag | select(Predicate<? super T> predicate)
Implements org. Returns all elements of the source collection that return true when evaluating the predicate. |
| public ImmutableBag | selectByOccurrences(IntPredicate predicate)
Implements org. Returns all elements of the bag that have a number of occurrences that satisfy the predicate. |
| public <S> ImmutableBag | selectInstancesOf(Class<S> clazz)
Implements org. Returns all elements of the source collection that are instances of the Class |
| public int | size()
Implements org. Returns the number of items in this iterable. |
| public int | sizeDistinct()
Implements org. The size of the Bag when counting only distinct elements. |
| public MutableMap | toMapOfItemToCount()
Implements org. Converts the Bag to a Map of the Item type to its count as an Integer. |
| protected Object | |
| public <S> ImmutableBag | zip(Iterable<S> that)
Implements org.
Deprecated
in 6.0. Use
OrderedIterable#zip(Iterable) instead.
Returns a |
| public ImmutableSet | zipWithIndex()
Implements org.
Deprecated
in 6.0. Use
OrderedIterable#zipWithIndex() instead.
Zips this |