| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | addAll(Collection<? extends T> source)
Implements java. Adds all of the elements in the specified collection to this collection (optional operation). |
| protected boolean | |
| public boolean | addAllIterable(Iterable<? extends T> iterable)
Implements org.
|
| 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 | 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 MutableList | bottomOccurrences(int n)
Implements org. Returns the |
| public RichIterable | chunk(int size)
Implements org. Partitions elements in fixed size chunks. |
| public <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 <V> MutableBag | countByEach(Function<? super T, ? extends Iterable<V>> function)
Overrides org. 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 <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 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 T | detectIfNone(Predicate<? super T> predicate, Function0<? extends T> function)
Overrides default org. Returns the first element of the iterable for which the predicate evaluates to 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 <P> T | detectWithIfNone(Predicate2<? super T, ? super P> predicate, P parameter, Function0<? extends T> function)
Overrides org. Implements org. Returns the first element of the iterable that evaluates to true for the specified predicate2 and parameter, or returns the value of evaluating the specified function. |
| 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 T | getFirst()
Implements org. Returns the first element of an iterable. |
| protected abstract RichIterable | |
| public T | getLast()
Implements org. Returns the last element of an iterable. |
| public <V> MutableMap | groupByUniqueKey(Function<? super T, ? extends V> function)
Overrides default org. Implements org. For each element of the iterable, the function is evaluated, and the results of these evaluations are collected into a new map, where the transformed value is the key. |
| public T | max()
Overrides org. Implements org. Returns the maximum element out of this container based on the natural order. |
| 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. |
| 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 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 | removeAll(Collection<?> collection)
Implements java. Removes all of this collection's elements that are also contained in the specified collection (optional operation). |
| public boolean | retainAll(Collection<?> collection)
Implements java. Retains only the elements in this collection that are contained in the specified collection (optional operation). |
| public boolean | retainAllIterable(Iterable<?> iterable)
Implements org.
|
| public <P> Twin | selectAndRejectWith(Predicate2<? super T, ? super P> predicate, P parameter)
Implements org. Filters a collection into two separate collections based on a predicate returned via a Pair. |
| public <V> MutableObjectDoubleMap | sumByDouble(Function<? super T, ? extends V> groupBy, DoubleFunction<? super T> function)
Implements org. Groups and sums the values using the two specified functions. |
| public <V> MutableObjectDoubleMap | sumByFloat(Function<? super T, ? extends V> groupBy, FloatFunction<? super T> function)
Implements org. Groups and sums the values using the two specified functions. |
| public <V> MutableObjectLongMap | sumByInt(Function<? super T, ? extends V> groupBy, IntFunction<? super T> function)
Implements org. Groups and sums the values using the two specified functions. |
| public <V> MutableObjectLongMap | sumByLong(Function<? super T, ? extends V> groupBy, LongFunction<? super T> function)
Implements org. Groups and sums the values using the two specified functions. |
| public MutableList | topOccurrences(int n)
Implements org. Returns the |
| AbstractMutableBagIterable | back to summary |
|---|---|
| public AbstractMutableBagIterable() | |
| addAll | back to summary |
|---|---|
| public boolean addAll(Collection<? extends T> source) Implements java. Doc from java. Adds all of the elements in the specified collection to this collection (optional operation). The behavior of this operation is undefined if the specified collection is modified while the operation is in progress. (This implies that the behavior of this call is undefined if the specified collection is this collection, and this collection is nonempty.) If the specified collection has a defined encounter order, processing of its elements generally occurs in that order.
| |
| addAllBag | back to summary |
|---|---|
| protected boolean addAllBag(Bag<? extends T> source) | |
| addAllIterable | back to summary |
|---|---|
| public boolean addAllIterable(Iterable<? extends T> iterable) Implements org.
| |
| allSatisfy | back to summary |
|---|---|
| public boolean allSatisfy(Predicate<? super T> predicate) Overrides org. Implements org. Doc from org. Returns true if the predicate evaluates to true for every element of the iterable or if the iterable is empty. Otherwise, returns false.
| |
| allSatisfyWith | back to summary |
|---|---|
| public <P> boolean allSatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter) Overrides org. Implements org. Doc from org. Returns true if the predicate evaluates to true for every element of the collection, or returns false.
| |
| anySatisfy | back to summary |
|---|---|
| public boolean anySatisfy(Predicate<? super T> predicate) Overrides org. Implements org. Doc from org. Returns true if the predicate evaluates to true for any element of the iterable. Returns false if the iterable is empty, or if no element returned true when evaluating the predicate.
| |
| anySatisfyWith | back to summary |
|---|---|
| public <P> boolean anySatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter) Overrides org. Implements org. Doc from org. Returns true if the predicate evaluates to true for any element of the collection, or return false. Returns false if the collection is empty.
| |
| bottomOccurrences | back to summary |
|---|---|
| public MutableList Implements org. Doc from org. Returns the
| |
| chunk | back to summary |
|---|---|
| public RichIterable Implements org. Doc from org. Partitions elements in fixed size chunks.
| |
| countBy | back to summary |
|---|---|
| public <V> MutableBag Overrides default org. Doc from org. This method will count the number of occurrences of each value calculated by applying the function to each element of the collection.
| |
| countByEach | back to summary |
|---|---|
| public <V> MutableBag Overrides org. Overrides default org. Doc from org. This method will count the number of occurrences of each value calculated by applying the function to each element of the collection.
| |
| countByWith | back to summary |
|---|---|
| public <V, P> MutableBag Overrides default org. Doc from 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.
| |
| detect | back to summary |
|---|---|
| public T detect(Predicate<? super T> predicate) Overrides org. Implements org. Doc from 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. This method is commonly called find. Example using a Java 8 lambda expression:
Person person =
people.detect(person -> person.getFirstName().equals("John") && person.getLastName().equals("Smith"));
| |
| detectIfNone | back to summary |
|---|---|
| public T detectIfNone(Predicate<? super T> predicate, Function0<? extends T> function) Overrides default org. Doc from org. Returns the first element of the iterable for which the predicate evaluates to true. If no element matches the predicate, then returns the value of applying the specified function.
| |
| detectOptional | back to summary |
|---|---|
| public Optional Overrides org. Implements org. Doc from org. Returns the first element of the iterable for which the predicate evaluates to true as an Optional. This method is commonly called find. Example using a Java 8 lambda expression:
Person person =
people.detectOptional(person -> person.getFirstName().equals("John") && person.getLastName().equals("Smith"));
| |
| detectWith | back to summary |
|---|---|
| public <P> T detectWith(Predicate2<? super T, ? super P> predicate, P parameter) Overrides org. Implements org. Doc from org. Returns the first element that evaluates to true for the specified predicate2 and parameter, or null if none evaluate to true. Example using a Java 8 lambda expression:
Person person =
people.detectWith((person, fullName) -> person.getFullName().equals(fullName), "John Smith");
| |
| detectWithIfNone | back to summary |
|---|---|
| public <P> T detectWithIfNone(Predicate2<? super T, ? super P> predicate, P parameter, Function0<? extends T> function) Overrides org. Implements org. Doc from org. Returns the first element of the iterable that evaluates to true for the specified predicate2 and parameter, or returns the value of evaluating the specified function.
| |
| detectWithOptional | back to summary |
|---|---|
| public <P> Optional Overrides org. Implements org. Doc from org. Returns the first element that evaluates to true for the specified predicate2 and parameter as an Optional. Example using a Java 8 lambda expression:
Optional<Person> person =
people.detectWithOptional((person, fullName) -> person.getFullName().equals(fullName), "John Smith");
| |
| getFirst | back to summary |
|---|---|
| public T getFirst() Implements org. Doc from org. Returns the first element of an iterable. In the case of a List it is the element at the first index. In the case of any other Collection, it is the first element that would be returned during an iteration. If the iterable is empty, null is returned. If null is a valid element of the container, then a developer would need to check to see if the iterable is empty to validate that a null result was not due to the container being empty. The order of Sets are not guaranteed (except for TreeSets and other Ordered Set implementations), so if you use this method, the first element could be any element from the Set.
| |
| getKeysView | back to summary |
|---|---|
| protected abstract RichIterable | |
| getLast | back to summary |
|---|---|
| public T getLast() Implements org. Doc from org. Returns the last element of an iterable. In the case of a List it is the element at the last index. In the case of any other Collection, it is the last element that would be returned during an iteration. If the iterable is empty, null is returned. If null is a valid element of the container, then a developer would need to check to see if the iterable is empty to validate that a null result was not due to the container being empty. The order of Sets are not guaranteed (except for TreeSets and other Ordered Set implementations), so if you use this method, the last element could be any element from the Set.
| |
| groupByUniqueKey | back to summary |
|---|---|
| public <V> MutableMap Overrides default org. Implements org. Doc from org. For each element of the iterable, the function is evaluated, and the results of these evaluations are collected into a new map, where the transformed value is the key. The generated keys must each be unique, or else an exception is thrown.
| |
| max | back to summary |
|---|---|
| public T max() Overrides org. Implements org. Doc from org. Returns the maximum element out of this container based on the natural order.
| |
| max | back to summary |
|---|---|
| public T max(Comparator<? super T> comparator) Overrides org. Implements org. Doc from org. Returns the maximum element out of this container based on the comparator.
| |
| maxBy | back to summary |
|---|---|
| public <V extends Comparable Overrides org. Implements org. Doc from org. Returns the maximum elements out of this container based on the natural order of the attribute returned by Function.
| |
| min | back to summary |
|---|---|
| public T min() Overrides org. Implements org. Doc from org. Returns the minimum element out of this container based on the natural order.
| |
| min | back to summary |
|---|---|
| public T min(Comparator<? super T> comparator) Overrides org. Implements org. Doc from org. Returns the minimum element out of this container based on the comparator.
| |
| minBy | back to summary |
|---|---|
| public <V extends Comparable Overrides org. Implements org. Doc from org. Returns the minimum elements out of this container based on the natural order of the attribute returned by Function.
| |
| noneSatisfy | back to summary |
|---|---|
| public boolean noneSatisfy(Predicate<? super T> predicate) Overrides org. Implements org. Doc from org. Returns true if the predicate evaluates to false for every element of the iterable or if the iterable is empty. Otherwise, returns false.
| |
| noneSatisfyWith | back to summary |
|---|---|
| public <P> boolean noneSatisfyWith(Predicate2<? super T, ? super P> predicate, P parameter) Overrides org. Implements org. Doc from org. Returns true if the predicate evaluates to false for every element of the collection, or return false. Returns true if the collection is empty.
| |
| removeAll | back to summary |
|---|---|
| public boolean removeAll(Collection<?> collection) Implements java. Doc from java. Removes all of this collection's elements that are also contained in the specified collection (optional operation). After this call returns, this collection will contain no elements in common with the specified collection.
| |
| retainAll | back to summary |
|---|---|
| public boolean retainAll(Collection<?> collection) Implements java. Doc from java. Retains only the elements in this collection that are contained in the specified collection (optional operation). In other words, removes from this collection all of its elements that are not contained in the specified collection.
| |
| retainAllIterable | back to summary |
|---|---|
| public boolean retainAllIterable(Iterable<?> iterable) Implements org.
| |
| selectAndRejectWith | back to summary |
|---|---|
| public <P> Twin Implements org. Doc from org. Filters a collection into two separate collections based on a predicate returned via a Pair. e.g. return lastNames.selectAndRejectWith(Predicates2.lessThan(), "Mason");
| |
| sumByDouble | back to summary |
|---|---|
| public <V> MutableObjectDoubleMap Implements org. Doc from org. Groups and sums the values using the two specified functions.
| |
| sumByFloat | back to summary |
|---|---|
| public <V> MutableObjectDoubleMap Implements org. Doc from org. Groups and sums the values using the two specified functions.
| |
| sumByInt | back to summary |
|---|---|
| public <V> MutableObjectLongMap Implements org. Doc from org. Groups and sums the values using the two specified functions.
| |
| sumByLong | back to summary |
|---|---|
| public <V> MutableObjectLongMap Implements org. Doc from org. Groups and sums the values using the two specified functions.
| |
| topOccurrences | back to summary |
|---|---|
| public MutableList Implements org. Doc from org. Returns the
| |