| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| private final Comparator | |
| private final T[] | |
| private final int[] | |
| private static final long | |
| private final int |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| private |
| 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> ImmutableList | collectWithIndex(ObjectIntToObjectFunction<? super T, ? extends V> function)
Overrides default org. Returns a new OrderedIterable using results obtained by applying the specified function to each element and its corresponding index. |
| public <V, R extends Collection | collectWithIndex(ObjectIntToObjectFunction<? super T, ? extends V> function, R target)
Overrides default org. Adds elements to the target Collection using results obtained by applying the specified function to each element and its corresponding index. |
| public Comparator | comparator()
Implements org. Returns the comparator used to order the elements in this bag, or null if this bag uses the natural ordering of its elements. |
| public int | compareTo(SortedBag<T> otherBag)
Implements java. Compares this object with the specified object for order. |
| public boolean | contains(Object object)
Overrides org. Implements org. Returns true if the iterable has an element which responds true to element.equals(object). |
| public <S> boolean | corresponds(OrderedIterable<S> other, Predicate2<? super T, ? super S> predicate)
Implements org. Returns true if both OrderedIterables have the same length
and |
| 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 int | detectIndex(Predicate<? super T> predicate)
Implements org. Returns the index of the first element of the |
| private int | |
| 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 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 ImmutableSortedSet | distinct()
Implements org. Returns a new |
| public RichIterable | distinctView()
Overrides default org. Returns an unmodifiable view on the distinct elements with the same complexity as the Bag implementation. |
| public ImmutableSortedBag | drop(int count)
Implements org. Returns an iterable after skipping the first |
| public ImmutableSortedBag | dropWhile(Predicate<? super T> predicate)
Implements org. Returns the final elements that do not satisfy the Predicate. |
| 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 void | forEach(int fromIndex, int toIndex, Procedure<? super T> procedure)
Implements org. Iterates over the section of the iterable covered by the specified inclusive indexes. |
| public void | forEachWithIndex(ObjectIntProcedure<? super T> objectIntProcedure)
Overrides org. Implements org. Iterates over the iterable passing each element and the current relative int index to the specified instance of ObjectIntProcedure. |
| public void | forEachWithIndex(int fromIndex, int toIndex, ObjectIntProcedure<? super T> objectIntProcedure)
Implements org. Iterates over the section of the iterable covered by the specified inclusive indexes. |
| public void | forEachWithOccurrences(ObjectIntProcedure<? super T> procedure)
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 int | hashCode()
Overrides java. Implements org. Returns the hash code for this Bag, defined as this. |
| public int | indexOf(Object object)
Overrides default org. Returns the index of the first occurrence of the specified item in this iterable, or -1 if this iterable does not contain the item. |
| public Iterator | iterator()
Implements java. Returns an iterator over elements of type |
| public T | max()
Overrides org. Implements org. Returns the maximum element out of this container based on the natural order, not the order of this bag. |
| public T | max(Comparator<? super T> comparator)
Overrides org. Implements org. Returns the maximum element out of this container based on the comparator. |
| 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()
Overrides org. Implements org. Returns the minimum element out of this container based on the natural order, not the order of this bag. |
| public T | min(Comparator<? super T> comparator)
Overrides org. Implements org. Returns the minimum element out of this container based on the comparator. |
| 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. |
| public ImmutableSortedBag | newWith(T element)
Implements org. This method is similar to the |
| public ImmutableSortedBag | newWithAll(Iterable<? extends T> elements)
Implements org. This method is similar to the |
| public ImmutableSortedBag | 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 PartitionImmutableSortedBag | partitionWhile(Predicate<? super T> predicate)
Implements org. Returns a Partition of the initial elements that satisfy the Predicate and the remaining elements. |
| 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 ImmutableSortedBag | take(int count)
Implements org. Returns the first |
| public ImmutableSortedBag | takeWhile(Predicate<? super T> predicate)
Implements org. Returns the initial elements that satisfy the Predicate. |
| public Object[] | toArray()
Overrides org. Overrides default org. Implements java. Converts this iterable to an array. |
| public <E> E[] | toArray(E[] array)
Overrides org. Overrides default org. Implements java. Converts this iterable to an array using the specified target array, assuming the target array is as long or longer than the iterable. |
| public MutableSortedMap | toMapOfItemToCount()
Implements org. Converts the Bag to a Map of the Item type to its count as an Integer. |
| public MutableList | toSortedList()
Overrides default org. Converts the collection to a MutableList implementation and sorts it using the natural order of the elements. |
| public MutableSortedSet | toSortedSet()
Overrides org. Implements org. Converts the collection to a MutableSortedSet implementation and sorts it using the natural order of the elements. |
| public MutableSortedSet | toSortedSet(Comparator<? super T> comparator)
Overrides org. Implements org. Converts the collection to a MutableSortedSet implementation and sorts it using the specified comparator. |