| Modifier and Type | Field and Description |
|---|---|
| protected static final int | |
| protected static final float | |
| protected float | |
| protected int |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected int | |
| protected abstract void | |
| 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 MutableSet | asSynchronized()
Implements org. Returns a synchronized wrapper backed by this collection. |
| public MutableSet | asUnmodifiable()
Implements org. Returns an unmodifiable view of the set. |
| public <B> LazyIterable | cartesianProduct(SetIterable<B> set)
Implements org. Returns the set whose members are all possible ordered pairs (a, b) where a is a member of |
| public RichIterable | chunk(int size)
Overrides org. Implements org. Partitions elements in fixed size chunks. |
| public abstract MutableSet | clone()
Redeclares org. Overrides java. Creates and returns a copy of this object. |
| public <V> UnifiedSet | 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> UnifiedSet | 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 <P, A> UnifiedSet | collectWith(Function2<? super T, ? super P, ? extends A> function, P parameter)
Implements org. Same as |
| protected void | |
| protected abstract T | |
| 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. |
| protected abstract Optional | |
| 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 MutableSet | difference(SetIterable<? extends T> subtrahendSet)
Implements org. Returns the set of all members of |
| public <R extends Set | differenceInto(SetIterable<? extends T> subtrahendSet, R targetSet)
Implements org. Same as |
| public <V> UnifiedSet | flatCollect(Function<? super T, ? extends Iterable<V>> function)
Implements org.
|
| public int | getBatchCount(int batchSize)
Implements org.
|
| protected abstract Object[] | |
| public <V> MutableMap | groupByUniqueKey(Function<? super T, ? extends V> function)
Overrides org. 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. |
| protected int | |
| public <IV, P> IV | injectIntoWith(IV injectValue, Function3<? super IV, ? super T, ? super P, ? extends IV> function, P parameter)
Overrides org. Implements org. Returns the final result of evaluating function using each element of the iterable, the previous evaluation result and the parameters. |
| public MutableSet | intersect(SetIterable<? extends T> set)
Implements org. Returns the set of all objects that are members of both |
| public <R extends Set | intersectInto(SetIterable<? extends T> set, R targetSet)
Implements org. Same as |
| public boolean | isProperSubsetOf(SetIterable<? extends T> candidateSuperset)
Implements org. Returns true if all the members of |
| public boolean | isSubsetOf(SetIterable<? extends T> candidateSuperset)
Implements org. Returns true if all the members of |
| public abstract MutableSet | |
| 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 MutableSet | powerSet()
Implements org. Returns the set whose members are all possible subsets of |
| protected abstract void | |
| protected void | |
| public boolean | |
| public boolean | retainAll(Collection<?> collection)
Overrides org. Implements java. Retains only the elements in this set that are contained in the specified collection (optional operation). |
| protected abstract boolean | shortCircuit(Predicate<? super T> predicate, boolean expected, boolean onShortCircuit, boolean atEnd, int start, int end)
|
| protected boolean | shortCircuit(Predicate<? super T> predicate, boolean expected, boolean onShortCircuit, boolean atEnd)
|
| protected abstract <P> boolean | shortCircuitWith(Predicate2<? super T, ? super P> predicate2, P parameter, boolean expected, boolean onShortCircuit, boolean atEnd)
|
| public MutableSet | symmetricDifference(SetIterable<? extends T> setB)
Implements org. Returns the set of all objects that are a member of exactly one of |
| public <R extends Set | symmetricDifferenceInto(SetIterable<? extends T> set, R targetSet)
Implements org. Same as |
| public MutableSet | union(SetIterable<? extends T> set)
Implements org. Returns the set of all objects that are a member of |
| public <R extends Set | unionInto(SetIterable<? extends T> set, R targetSet)
Implements org. Same as |
| public <S> MutableSet | zip(Iterable<S> that)
Implements org.
Deprecated
in 6.0. Use
OrderedIterable#zip(Iterable) instead.
Returns a |
| public MutableSet | zipWithIndex()
Implements org.
Deprecated
in 6.0. Use
OrderedIterable#zipWithIndex() instead.
Zips this |
| DEFAULT_INITIAL_CAPACITY | back to summary |
|---|---|
| protected static final int DEFAULT_INITIAL_CAPACITY | |
| DEFAULT_LOAD_FACTOR | back to summary |
|---|---|
| protected static final float DEFAULT_LOAD_FACTOR | |
| loadFactor | back to summary |
|---|---|
| protected float loadFactor | |
| maxSize | back to summary |
|---|---|
| protected int maxSize | |
| AbstractUnifiedSet | back to summary |
|---|---|
| public AbstractUnifiedSet() | |
| allocate | back to summary |
|---|---|
| protected int allocate(int capacity) | |
| allocateTable | back to summary |
|---|---|
| protected abstract void allocateTable(int sizeToAllocate) | |
| 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.
| |
| asSynchronized | back to summary |
|---|---|
| public MutableSet Implements org. Doc from org. Returns a synchronized wrapper backed by this collection. This is the equivalent of using
MutableCollection synchedCollection = collection.asSynchronized();
...
synchedCollection.forEach(each -> ... );
synchedCollection.select(each -> ... );
synchedCollection.collect(each -> ... );
If you want to iterate using an imperative style, you must protect external iterators using
a synchronized block. This includes explicit iterators as well as JDK 5 style for loops.
| |
| asUnmodifiable | back to summary |
|---|---|
| public MutableSet Implements org. Doc from org. Returns an unmodifiable view of the set.
| |
| cartesianProduct | back to summary |
|---|---|
| public <B> LazyIterable Implements org. Doc from org. Returns the set whose members are all possible ordered pairs (a, b) where a is a member of
| |
| chunk | back to summary |
|---|---|
| public RichIterable Overrides org. Implements org. Doc from org. Partitions elements in fixed size chunks.
| |
| clone | back to summary |
|---|---|
| public abstract MutableSet Redeclares org. Overrides java. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by
| |
| collect | back to summary |
|---|---|
| public <V> UnifiedSet Implements org. Doc from org. Returns a new collection with the results of applying the specified function on each element of the source collection. This method is also commonly called transform or map. Example using a Java 8 lambda expression:
RichIterable<String> names =
people.collect(person -> person.getFirstName() + " " + person.getLastName());
| |
| collectIf | back to summary |
|---|---|
| public <V> UnifiedSet Implements org. Doc from 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. This is the optimized equivalent of calling iterable.select(predicate).collect(function). Example using a Java 8 lambda and method reference: RichIterable<String> strings = Lists.mutable.with(1, 2, 3).collectIf(e -> e != null, Object::toString); Example using Predicates factory: RichIterable<String> strings = Lists.mutable.with(1, 2, 3).collectIf(Predicates.notNull(), Functions.getToString());
| |
| collectWith | back to summary |
|---|---|
| public <P, A> UnifiedSet Implements org. Doc from org. Same as Example using a Java 8 lambda expression:
RichIterable<Integer> integers =
Lists.mutable.with(1, 2, 3).collectWith((each, parameter) -> each + parameter, Integer.valueOf(1));
| |
| computeMaxSize | back to summary |
|---|---|
| protected void computeMaxSize(int capacity) | |
| detect | back to summary |
|---|---|
| protected abstract T detect(Predicate<? super T> predicate, int start, int end) | |
| 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"));
| |
| detectOptional | back to summary |
|---|---|
| protected abstract Optional | |
| 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"));
| |
| difference | back to summary |
|---|---|
| public MutableSet Implements org. Doc from org. Returns the set of all members of
| |
| differenceInto | back to summary |
|---|---|
| public <R extends Set Implements org. Doc from org. Same as
| |
| flatCollect | back to summary |
|---|---|
| public <V> UnifiedSet Implements org. Doc from org.
Consider the following example where we have a Function<Person, List<Address>> addressFunction = Person::getAddresses; RichIterable<Person> people = ...;Using collect returns a collection of collections of addresses.
RichIterable<List<Address>> addresses = people.collect(addressFunction);Using flatCollect returns a single flattened list of addresses.
RichIterable<Address> addresses = people.flatCollect(addressFunction);
| |
| getBatchCount | back to summary |
|---|---|
| public int getBatchCount(int batchSize) Implements org.
| |
| getTable | back to summary |
|---|---|
| protected abstract Object[] getTable() | |
| groupByUniqueKey | back to summary |
|---|---|
| public <V> MutableMap Overrides org. 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.
| |
| init | back to summary |
|---|---|
| protected int init(int initialCapacity) | |
| injectIntoWith | back to summary |
|---|---|
| public <IV, P> IV injectIntoWith(IV injectValue, Function3<? super IV, ? super T, ? super P, ? extends IV> function, P parameter) Overrides org. Implements org. Doc from org. Returns the final result of evaluating function using each element of the iterable, the previous evaluation result and the parameters. The injected value is used for the first parameter of the first evaluation, and the current item in the iterable is used as the second parameter. The parameter value is always used as the third parameter to the function call.
| |
| intersect | back to summary |
|---|---|
| public MutableSet Implements org. Doc from org. Returns the set of all objects that are members of both Note If you need to ensure that the memory references from
| |
| intersectInto | back to summary |
|---|---|
| public <R extends Set Implements org. Doc from org. Same as
| |
| isProperSubsetOf | back to summary |
|---|---|
| public boolean isProperSubsetOf(SetIterable<? extends T> candidateSuperset) Implements org. Doc from org. Returns true if all the members of
| |
| isSubsetOf | back to summary |
|---|---|
| public boolean isSubsetOf(SetIterable<? extends T> candidateSuperset) Implements org. Doc from org. Returns true if all the members of
| |
| newEmpty | back to summary |
|---|---|
| public abstract MutableSet | |
| 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.
| |
| powerSet | back to summary |
|---|---|
| public MutableSet Implements org. Doc from org. Returns the set whose members are all possible subsets of
| |
| rehash | back to summary |
|---|---|
| protected abstract void rehash(int newCapacity) | |
| rehash | back to summary |
|---|---|
| protected void rehash() | |
| removeAllIterable | back to summary |
|---|---|
| public boolean removeAllIterable(Iterable<?> iterable) Overrides org. Implements org.
| |
| retainAll | back to summary |
|---|---|
| public boolean retainAll(Collection<?> collection) Overrides org. Implements java. Doc from java. Retains only the elements in this set that are contained in the specified collection (optional operation). In other words, removes from this set all of its elements that are not contained in the specified collection. If the specified collection is also a set, this operation effectively modifies this set so that its value is the intersection of the two sets.
| |
| shortCircuit | back to summary |
|---|---|
| protected abstract boolean shortCircuit(Predicate<? super T> predicate, boolean expected, boolean onShortCircuit, boolean atEnd, int start, int end) | |
| shortCircuit | back to summary |
|---|---|
| protected boolean shortCircuit(Predicate<? super T> predicate, boolean expected, boolean onShortCircuit, boolean atEnd) | |
| shortCircuitWith | back to summary |
|---|---|
| protected abstract <P> boolean shortCircuitWith(Predicate2<? super T, ? super P> predicate2, P parameter, boolean expected, boolean onShortCircuit, boolean atEnd) | |
| symmetricDifference | back to summary |
|---|---|
| public MutableSet Implements org. Doc from org. Returns the set of all objects that are a member of exactly one of
| |
| symmetricDifferenceInto | back to summary |
|---|---|
| public <R extends Set Implements org. Doc from org. Same as
| |
| union | back to summary |
|---|---|
| public MutableSet Implements org. Doc from org. Returns the set of all objects that are a member of
| |
| unionInto | back to summary |
|---|---|
| public <R extends Set Implements org. Doc from org. Same as
| |
| zip | back to summary |
|---|---|
| public <S> MutableSet Implements org. Doc from org. Deprecated in 6.0. Use Returns a
| |
| zipWithIndex | back to summary |
|---|---|
| public MutableSet Implements org. Doc from org. Deprecated in 6.0. Use Zips this
| |