Class AbstractUnifiedSet<T>
- All Implemented Interfaces:
Cloneable,Iterable<T>,Collection<T>,Set<T>,MutableCollection<T>,InternalIterable<T>,RichIterable<T>,MutableSet<T>,MutableSetIterable<T>,Pool<T>,SetIterable<T>,UnsortedSetIterable<T>,BatchIterable<T>
- Direct Known Subclasses:
UnifiedSet,UnifiedSetWithHashingStrategy
public abstract class AbstractUnifiedSet<T> extends AbstractMutableCollection<T> implements MutableSet<T>, Pool<T>, BatchIterable<T>
-
Constructor Summary
Constructors Constructor Description AbstractUnifiedSet() -
Method Summary
Modifier and Type Method Description booleanallSatisfy(Predicate<? super T> predicate)Returns true if the predicate evaluates to true for every element of the iterable or if the iterable is empty.<P> booleanallSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)Returns true if the predicate evaluates to true for every element of the collection, or returns false.booleananySatisfy(Predicate<? super T> predicate)Returns true if the predicate evaluates to true for any element of the iterable.<P> booleananySatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)Returns true if the predicate evaluates to true for any element of the collection, or return false.MutableSet<T>asSynchronized()Returns a synchronized wrapper backed by this collection.MutableSet<T>asUnmodifiable()Returns an unmodifiable view of the set.<B> LazyIterable<Pair<T,B>>cartesianProduct(SetIterable<B> set)Returns the set whose members are all possible ordered pairs (a, b) where a is a member ofthisand b is a member ofset.RichIterable<RichIterable<T>>chunk(int size)Partitions elements in fixed size chunks.abstract MutableSet<T>clone()<V> UnifiedSet<V>collect(Function<? super T,? extends V> function)Returns a new collection with the results of applying the specified function on each element of the source collection.MutableBooleanSetcollectBoolean(BooleanFunction<? super T> booleanFunction)Returns a new primitivebooleaniterable with the results of applying the specified function on each element of the source collection.MutableByteSetcollectByte(ByteFunction<? super T> byteFunction)Returns a new primitivebyteiterable with the results of applying the specified function on each element of the source collection.MutableCharSetcollectChar(CharFunction<? super T> charFunction)Returns a new primitivechariterable with the results of applying the specified function on each element of the source collection.MutableDoubleSetcollectDouble(DoubleFunction<? super T> doubleFunction)Returns a new primitivedoubleiterable with the results of applying the specified function on each element of the source collection.MutableFloatSetcollectFloat(FloatFunction<? super T> floatFunction)Returns a new primitivefloatiterable with the results of applying the specified function on each element of the source collection.<V> UnifiedSet<V>collectIf(Predicate<? super T> predicate, Function<? super T,? extends V> function)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.MutableIntSetcollectInt(IntFunction<? super T> intFunction)Returns a new primitiveintiterable with the results of applying the specified function on each element of the source collection.MutableLongSetcollectLong(LongFunction<? super T> longFunction)Returns a new primitivelongiterable with the results of applying the specified function on each element of the source collection.MutableShortSetcollectShort(ShortFunction<? super T> shortFunction)Returns a new primitiveshortiterable with the results of applying the specified function on each element of the source collection.<P, A> UnifiedSet<A>collectWith(Function2<? super T,? super P,? extends A> function, P parameter)Same asRichIterable.collect(Function)with aFunction2and specified parameter which is passed to the block.Tdetect(Predicate<? super T> predicate)Returns the first element of the iterable for which the predicate evaluates to true or null in the case where no element returns true.Optional<T>detectOptional(Predicate<? super T> predicate)Returns the first element of the iterable for which the predicate evaluates to true as an Optional.MutableSet<T>difference(SetIterable<? extends T> subtrahendSet)Returns the set of all members ofthisthat are not members ofsubtrahendSet.<R extends Set<T>>
RdifferenceInto(SetIterable<? extends T> subtrahendSet, R targetSet)Same asSetIterable.difference(SetIterable)but adds all the objects totargetSetand returns it.<V> UnifiedSet<V>flatCollect(Function<? super T,? extends Iterable<V>> function)flatCollectis a special case ofRichIterable.collect(Function).intgetBatchCount(int batchSize)<V> MutableMap<V,T>groupByUniqueKey(Function<? super T,? extends V> function)For each element of the iterable, the function is evaluated and he results of these evaluations are collected into a new map, where the transformed value is the key.<IV, P> IVinjectIntoWith(IV injectValue, Function3<? super IV,? super T,? super P,? extends IV> function, P parameter)Returns the final result of evaluating function using each element of the iterable, the previous evaluation result and the parameters.MutableSet<T>intersect(SetIterable<? extends T> set)Returns the set of all objects that are members of boththisandset.<R extends Set<T>>
RintersectInto(SetIterable<? extends T> set, R targetSet)Same asSetIterable.intersect(SetIterable)but adds all the objects totargetSetand returns it.booleanisProperSubsetOf(SetIterable<? extends T> candidateSuperset)Returns true if all the members ofthisare also members ofcandidateSupersetand the two sets are not equal.booleanisSubsetOf(SetIterable<? extends T> candidateSuperset)Returns true if all the members ofthisare also members ofcandidateSuperset.abstract MutableSet<T>newEmpty(int size)booleannoneSatisfy(Predicate<? super T> predicate)Returns true if the predicate evaluates to false for every element of the iterable or if the iterable is empty.<P> booleannoneSatisfyWith(Predicate2<? super T,? super P> predicate, P parameter)Returns true if the predicate evaluates to false for every element of the collection, or return false.MutableSet<UnsortedSetIterable<T>>powerSet()Returns the set whose members are all possible subsets ofthis.booleanremoveAllIterable(Iterable<?> iterable)booleanretainAll(Collection<?> collection)MutableSet<T>symmetricDifference(SetIterable<? extends T> setB)Returns the set of all objects that are a member of exactly one ofthisandsetB(elements which are in one of the sets, but not in both).<R extends Set<T>>
RsymmetricDifferenceInto(SetIterable<? extends T> set, R targetSet)Same asSetIterable.symmetricDifference(SetIterable)but adds all the objects totargetSetand returns it.MutableSet<T>union(SetIterable<? extends T> set)Returns the set of all objects that are a member ofthisorsetor both.<R extends Set<T>>
RunionInto(SetIterable<? extends T> set, R targetSet)Same asSetIterable.union(SetIterable)but adds all the objects totargetSetand returns it.<S> MutableSet<Pair<T,S>>zip(Iterable<S> that)Deprecated.in 6.0.MutableSet<Pair<T,Integer>>zipWithIndex()Deprecated.in 6.0.Methods inherited from class org.eclipse.collections.impl.collection.mutable.AbstractMutableCollection
add, addAll, addAllIterable, aggregateInPlaceBy, countBy, countByEach, countByWith, reduce, remove, removeAll, removeIf, removeIfWith, retainAllIterable, selectAndRejectWith, sumByDouble, sumByFloat, sumByInt, sumByLongMethods inherited from class org.eclipse.collections.impl.AbstractRichIterable
appendString, appendString, asLazy, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, count, countWith, detectWith, detectWithIfNone, detectWithOptional, flatCollect, forEach, forEachWith, forEachWithIndex, groupBy, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, into, isEmpty, max, max, maxBy, min, min, minBy, reject, rejectWith, select, selectWith, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toBiMap, toList, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndexMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.collections.impl.parallel.BatchIterable
batchForEach, forEach, sizeMethods inherited from interface org.eclipse.collections.api.InternalIterable
forEach, forEachWith, forEachWithIndexMethods inherited from interface org.eclipse.collections.api.collection.MutableCollection
addAllIterable, aggregateBy, aggregateInPlaceBy, countBy, countByEach, countByWith, flatCollectWith, partition, partitionWith, reject, rejectWith, removeIf, removeIfWith, retainAllIterable, select, selectAndRejectWith, selectInstancesOf, selectWith, sumByDouble, sumByFloat, sumByInt, sumByLong, tap, toImmutableMethods inherited from interface org.eclipse.collections.api.set.MutableSet
flatCollectWith, groupBy, groupByEach, newEmpty, partition, partitionWith, reject, rejectWith, select, selectInstancesOf, selectWith, tap, toImmutable, with, withAll, without, withoutAllMethods inherited from interface org.eclipse.collections.api.set.Pool
clear, get, put, removeFromPool, sizeMethods inherited from interface org.eclipse.collections.api.RichIterable
aggregateBy, appendString, appendString, appendString, asLazy, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, containsBy, count, countBy, countByEach, countByWith, countWith, detectIfNone, detectWith, detectWithIfNone, detectWithOptional, each, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, flatCollectWith, forEach, getAny, getFirst, getLast, getOnly, groupBy, groupByAndCollect, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, into, isEmpty, makeString, makeString, makeString, max, max, maxBy, maxByOptional, maxOptional, maxOptional, min, min, minBy, minByOptional, minOptional, minOptional, notEmpty, reduce, reduceInPlace, reduceInPlace, reject, rejectWith, select, selectWith, size, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toBiMap, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndex
-
Constructor Details
-
AbstractUnifiedSet
public AbstractUnifiedSet()
-
-
Method Details
-
clone
- Specified by:
clonein interfaceMutableSet<T>
-
newEmpty
-
getBatchCount
public int getBatchCount(int batchSize)- Specified by:
getBatchCountin interfaceBatchIterable<T>
-
collect
Description copied from interface:RichIterableReturns 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());Example using an anonymous inner class:
RichIterable<String> names = people.collect(new Function<Person, String>() { public String valueOf(Person person) { return person.getFirstName() + " " + person.getLastName(); } });- Specified by:
collectin interfaceMutableCollection<T>- Specified by:
collectin interfaceMutableSet<T>- Specified by:
collectin interfaceRichIterable<T>- Specified by:
collectin interfaceUnsortedSetIterable<T>
-
collectBoolean
Description copied from interface:RichIterableReturns a new primitivebooleaniterable 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:
BooleanIterable licenses = people.collectBoolean(person -> person.hasDrivingLicense());Example using an anonymous inner class:
BooleanIterable licenses = people.collectBoolean(new BooleanFunction<Person>() { public boolean booleanValueOf(Person person) { return person.hasDrivingLicense(); } });- Specified by:
collectBooleanin interfaceMutableCollection<T>- Specified by:
collectBooleanin interfaceMutableSet<T>- Specified by:
collectBooleanin interfaceRichIterable<T>- Specified by:
collectBooleanin interfaceUnsortedSetIterable<T>
-
collectByte
Description copied from interface:RichIterableReturns a new primitivebyteiterable 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:
ByteIterable bytes = people.collectByte(person -> person.getCode());Example using an anonymous inner class:
ByteIterable bytes = people.collectByte(new ByteFunction<Person>() { public byte byteValueOf(Person person) { return person.getCode(); } });- Specified by:
collectBytein interfaceMutableCollection<T>- Specified by:
collectBytein interfaceMutableSet<T>- Specified by:
collectBytein interfaceRichIterable<T>- Specified by:
collectBytein interfaceUnsortedSetIterable<T>
-
collectChar
Description copied from interface:RichIterableReturns a new primitivechariterable 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:
CharIterable chars = people.collectChar(person -> person.getMiddleInitial());Example using an anonymous inner class:
CharIterable chars = people.collectChar(new CharFunction<Person>() { public char charValueOf(Person person) { return person.getMiddleInitial(); } });- Specified by:
collectCharin interfaceMutableCollection<T>- Specified by:
collectCharin interfaceMutableSet<T>- Specified by:
collectCharin interfaceRichIterable<T>- Specified by:
collectCharin interfaceUnsortedSetIterable<T>
-
collectDouble
Description copied from interface:RichIterableReturns a new primitivedoubleiterable 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:
DoubleIterable doubles = people.collectDouble(person -> person.getMilesFromNorthPole());Example using an anonymous inner class:
DoubleIterable doubles = people.collectDouble(new DoubleFunction<Person>() { public double doubleValueOf(Person person) { return person.getMilesFromNorthPole(); } });- Specified by:
collectDoublein interfaceMutableCollection<T>- Specified by:
collectDoublein interfaceMutableSet<T>- Specified by:
collectDoublein interfaceRichIterable<T>- Specified by:
collectDoublein interfaceUnsortedSetIterable<T>
-
collectFloat
Description copied from interface:RichIterableReturns a new primitivefloatiterable 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:
FloatIterable floats = people.collectFloat(person -> person.getHeightInInches());Example using an anonymous inner class:
FloatIterable floats = people.collectFloat(new FloatFunction<Person>() { public float floatValueOf(Person person) { return person.getHeightInInches(); } });- Specified by:
collectFloatin interfaceMutableCollection<T>- Specified by:
collectFloatin interfaceMutableSet<T>- Specified by:
collectFloatin interfaceRichIterable<T>- Specified by:
collectFloatin interfaceUnsortedSetIterable<T>
-
collectInt
Description copied from interface:RichIterableReturns a new primitiveintiterable 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:
IntIterable ints = people.collectInt(person -> person.getAge());Example using an anonymous inner class:
IntIterable ints = people.collectInt(new IntFunction<Person>() { public int intValueOf(Person person) { return person.getAge(); } });- Specified by:
collectIntin interfaceMutableCollection<T>- Specified by:
collectIntin interfaceMutableSet<T>- Specified by:
collectIntin interfaceRichIterable<T>- Specified by:
collectIntin interfaceUnsortedSetIterable<T>
-
collectLong
Description copied from interface:RichIterableReturns a new primitivelongiterable 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:
LongIterable longs = people.collectLong(person -> person.getGuid());Example using an anonymous inner class:
LongIterable longs = people.collectLong(new LongFunction<Person>() { public long longValueOf(Person person) { return person.getGuid(); } });- Specified by:
collectLongin interfaceMutableCollection<T>- Specified by:
collectLongin interfaceMutableSet<T>- Specified by:
collectLongin interfaceRichIterable<T>- Specified by:
collectLongin interfaceUnsortedSetIterable<T>
-
collectShort
Description copied from interface:RichIterableReturns a new primitiveshortiterable 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:
ShortIterable shorts = people.collectShort(person -> person.getNumberOfJunkMailItemsReceivedPerMonth());Example using an anonymous inner class:
ShortIterable shorts = people.collectShort(new ShortFunction<Person>() { public short shortValueOf(Person person) { return person.getNumberOfJunkMailItemsReceivedPerMonth(); } });- Specified by:
collectShortin interfaceMutableCollection<T>- Specified by:
collectShortin interfaceMutableSet<T>- Specified by:
collectShortin interfaceRichIterable<T>- Specified by:
collectShortin interfaceUnsortedSetIterable<T>
-
flatCollect
Description copied from interface:RichIterableflatCollectis a special case ofRichIterable.collect(Function). Withcollect, when theFunctionreturns a collection, the result is a collection of collections.flatCollectoutputs a single "flattened" collection instead. This method is commonly called flatMap.Consider the following example where we have a
Personclass, and eachPersonhas a list ofAddressobjects. Take the followingFunction:Function<Person, List<Address>> addressFunction = Person::getAddresses; RichIterable<Person> people = ...;
Usingcollectreturns a collection of collections of addresses.RichIterable<List<Address>> addresses = people.collect(addressFunction);
UsingflatCollectreturns a single flattened list of addresses.RichIterable<Address> addresses = people.flatCollect(addressFunction);
- Specified by:
flatCollectin interfaceMutableCollection<T>- Specified by:
flatCollectin interfaceMutableSet<T>- Specified by:
flatCollectin interfaceRichIterable<T>- Specified by:
flatCollectin interfaceUnsortedSetIterable<T>- Parameters:
function- TheFunctionto apply- Returns:
- a new flattened collection produced by applying the given
function
-
collectWith
public <P, A> UnifiedSet<A> collectWith(Function2<? super T,? super P,? extends A> function, P parameter)Description copied from interface:RichIterableSame asRichIterable.collect(Function)with aFunction2and specified parameter which is passed to the block.Example using a Java 8 lambda expression:
RichIterable<Integer> integers = Lists.mutable.with(1, 2, 3).collectWith((each, parameter) -> each + parameter, Integer.valueOf(1));Example using an anonymous inner class:
Function2<Integer, Integer, Integer> addParameterFunction = new Function2<Integer, Integer, Integer>() { public Integer value(Integer each, Integer parameter) { return each + parameter; } }; RichIterable<Integer> integers = Lists.mutable.with(1, 2, 3).collectWith(addParameterFunction, Integer.valueOf(1));- Specified by:
collectWithin interfaceMutableCollection<T>- Specified by:
collectWithin interfaceMutableSet<T>- Specified by:
collectWithin interfaceRichIterable<T>- Specified by:
collectWithin interfaceUnsortedSetIterable<T>- Parameters:
function- AFunction2to use as the collect transformation functionparameter- A parameter to pass in for evaluation of the second argumentPinfunction- Returns:
- A new
RichIterablethat contains the transformed elements returned byFunction2.value(Object, Object) - See Also:
RichIterable.collect(Function)
-
collectIf
public <V> UnifiedSet<V> collectIf(Predicate<? super T> predicate, Function<? super T,? extends V> function)Description copied from interface:RichIterableReturns 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 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());
- Specified by:
collectIfin interfaceMutableCollection<T>- Specified by:
collectIfin interfaceMutableSet<T>- Specified by:
collectIfin interfaceRichIterable<T>- Specified by:
collectIfin interfaceUnsortedSetIterable<T>
-
detect
Description copied from interface:RichIterableReturns 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"));Example using an anonymous inner class:
Person person = people.detect(new Predicate<Person>() { public boolean accept(Person person) { return person.getFirstName().equals("John") && person.getLastName().equals("Smith"); } });- Specified by:
detectin interfaceRichIterable<T>- Overrides:
detectin classAbstractRichIterable<T>
-
detectOptional
Description copied from interface:RichIterableReturns 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"));- Specified by:
detectOptionalin interfaceRichIterable<T>- Overrides:
detectOptionalin classAbstractRichIterable<T>
-
anySatisfy
Description copied from interface:RichIterableReturns 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.- Specified by:
anySatisfyin interfaceRichIterable<T>- Overrides:
anySatisfyin classAbstractRichIterable<T>
-
anySatisfyWith
Description copied from interface:RichIterableReturns true if the predicate evaluates to true for any element of the collection, or return false. Returns false if the collection is empty.- Specified by:
anySatisfyWithin interfaceRichIterable<T>- Overrides:
anySatisfyWithin classAbstractRichIterable<T>
-
allSatisfy
Description copied from interface:RichIterableReturns true if the predicate evaluates to true for every element of the iterable or if the iterable is empty. Otherwise, returns false.- Specified by:
allSatisfyin interfaceRichIterable<T>- Overrides:
allSatisfyin classAbstractRichIterable<T>
-
allSatisfyWith
Description copied from interface:RichIterableReturns true if the predicate evaluates to true for every element of the collection, or returns false.- Specified by:
allSatisfyWithin interfaceRichIterable<T>- Overrides:
allSatisfyWithin classAbstractRichIterable<T>
-
noneSatisfy
Description copied from interface:RichIterableReturns true if the predicate evaluates to false for every element of the iterable or if the iterable is empty. Otherwise, returns false.- Specified by:
noneSatisfyin interfaceRichIterable<T>- Overrides:
noneSatisfyin classAbstractRichIterable<T>
-
noneSatisfyWith
Description copied from interface:RichIterableReturns true if the predicate evaluates to false for every element of the collection, or return false. Returns true if the collection is empty.- Specified by:
noneSatisfyWithin interfaceRichIterable<T>- Overrides:
noneSatisfyWithin classAbstractRichIterable<T>
-
injectIntoWith
public <IV, P> IV injectIntoWith(IV injectValue, Function3<? super IV,? super T,? super P,? extends IV> function, P parameter)Description copied from interface:MutableCollectionReturns 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.- Specified by:
injectIntoWithin interfaceMutableCollection<T>- Overrides:
injectIntoWithin classAbstractMutableCollection<T>- See Also:
RichIterable.injectInto(Object, Function2)
-
asUnmodifiable
Description copied from interface:MutableSetReturns an unmodifiable view of the set.- Specified by:
asUnmodifiablein interfaceMutableCollection<T>- Specified by:
asUnmodifiablein interfaceMutableSet<T>- Returns:
- an unmodifiable view of this set
- See Also:
Collections.unmodifiableCollection(Collection)
-
asSynchronized
Description copied from interface:MutableCollectionReturns a synchronized wrapper backed by this collection. This is the equivalent of usingCollections.synchronizedCollection(this)only with a return type that supports the full iteration protocols available onMutableCollection. The preferred way of iterating over a synchronized collection is to use the internal iteration methods which are properly synchronized internally.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.- Specified by:
asSynchronizedin interfaceMutableCollection<T>- Specified by:
asSynchronizedin interfaceMutableSet<T>- Returns:
- a synchronized view of this collection.
- See Also:
Collections.synchronizedCollection(Collection)
-
removeAllIterable
- Specified by:
removeAllIterablein interfaceMutableCollection<T>- Overrides:
removeAllIterablein classAbstractMutableCollection<T>- See Also:
Collection.removeAll(Collection)
-
retainAll
- Specified by:
retainAllin interfaceCollection<T>- Specified by:
retainAllin interfaceSet<T>- Overrides:
retainAllin classAbstractMutableCollection<T>
-
groupByUniqueKey
Description copied from interface:RichIterableFor each element of the iterable, the function is evaluated and he 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.- Specified by:
groupByUniqueKeyin interfaceMutableCollection<T>- Specified by:
groupByUniqueKeyin interfaceRichIterable<T>- Overrides:
groupByUniqueKeyin classAbstractMutableCollection<T>- See Also:
RichIterable.groupBy(Function)
-
zip
Deprecated.in 6.0. UseOrderedIterable.zip(Iterable)instead.Description copied from interface:RichIterableReturns aRichIterableformed from thisRichIterableand anotherRichIterableby combining corresponding elements in pairs. If one of the twoRichIterables is longer than the other, its remaining elements are ignored.- Specified by:
zipin interfaceMutableCollection<T>- Specified by:
zipin interfaceMutableSet<T>- Specified by:
zipin interfaceMutableSetIterable<T>- Specified by:
zipin interfaceRichIterable<T>- Specified by:
zipin interfaceUnsortedSetIterable<T>- Type Parameters:
S- the type of the second half of the returned pairs- Parameters:
that- TheRichIterableproviding the second half of each result pair- Returns:
- A new
RichIterablecontaining pairs consisting of corresponding elements of thisRichIterableand that. The length of the returnedRichIterableis the minimum of the lengths of thisRichIterableand that.
-
zipWithIndex
Deprecated.in 6.0. UseOrderedIterable.zipWithIndex()instead.Description copied from interface:RichIterableZips thisRichIterablewith its indices.- Specified by:
zipWithIndexin interfaceMutableCollection<T>- Specified by:
zipWithIndexin interfaceMutableSet<T>- Specified by:
zipWithIndexin interfaceMutableSetIterable<T>- Specified by:
zipWithIndexin interfaceRichIterable<T>- Specified by:
zipWithIndexin interfaceSetIterable<T>- Specified by:
zipWithIndexin interfaceUnsortedSetIterable<T>- Returns:
- A new
RichIterablecontaining pairs consisting of all elements of thisRichIterablepaired with their index. Indices start at 0. - See Also:
RichIterable.zip(Iterable)
-
chunk
Description copied from interface:RichIterablePartitions elements in fixed size chunks.- Specified by:
chunkin interfaceRichIterable<T>- Overrides:
chunkin classAbstractMutableCollection<T>- Parameters:
size- the number of elements per chunk- Returns:
- A
RichIterablecontainingRichIterables of sizesize, except the last will be truncated if the elements don't divide evenly.
-
union
Description copied from interface:SetIterableReturns the set of all objects that are a member ofthisorsetor both. The union of [1, 2, 3] and [2, 3, 4] is the set [1, 2, 3, 4]. If equal elements appear in both sets, then the output will contain the copy fromthis.- Specified by:
unionin interfaceMutableSet<T>- Specified by:
unionin interfaceSetIterable<T>- Specified by:
unionin interfaceUnsortedSetIterable<T>
-
unionInto
Description copied from interface:SetIterableSame asSetIterable.union(SetIterable)but adds all the objects totargetSetand returns it.- Specified by:
unionIntoin interfaceSetIterable<T>
-
intersect
Description copied from interface:SetIterableReturns the set of all objects that are members of boththisandset. The intersection of [1, 2, 3] and [2, 3, 4] is the set [2, 3]. The output will contain instances fromthis, notset.- Specified by:
intersectin interfaceMutableSet<T>- Specified by:
intersectin interfaceSetIterable<T>- Specified by:
intersectin interfaceUnsortedSetIterable<T>
-
intersectInto
Description copied from interface:SetIterableSame asSetIterable.intersect(SetIterable)but adds all the objects totargetSetand returns it.- Specified by:
intersectIntoin interfaceSetIterable<T>
-
difference
Description copied from interface:SetIterableReturns the set of all members ofthisthat are not members ofsubtrahendSet. The difference of [1, 2, 3] and [2, 3, 4] is [1].- Specified by:
differencein interfaceMutableSet<T>- Specified by:
differencein interfaceSetIterable<T>- Specified by:
differencein interfaceUnsortedSetIterable<T>
-
differenceInto
Description copied from interface:SetIterableSame asSetIterable.difference(SetIterable)but adds all the objects totargetSetand returns it.- Specified by:
differenceIntoin interfaceSetIterable<T>
-
symmetricDifference
Description copied from interface:SetIterableReturns the set of all objects that are a member of exactly one ofthisandsetB(elements which are in one of the sets, but not in both). For instance, for the sets [1, 2, 3] and [2, 3, 4], the symmetric difference set is [1, 4] . It is the set difference of the union and the intersection.- Specified by:
symmetricDifferencein interfaceMutableSet<T>- Specified by:
symmetricDifferencein interfaceSetIterable<T>- Specified by:
symmetricDifferencein interfaceUnsortedSetIterable<T>
-
symmetricDifferenceInto
Description copied from interface:SetIterableSame asSetIterable.symmetricDifference(SetIterable)but adds all the objects totargetSetand returns it.- Specified by:
symmetricDifferenceIntoin interfaceSetIterable<T>
-
isSubsetOf
Description copied from interface:SetIterableReturns true if all the members ofthisare also members ofcandidateSuperset. For example, [1, 2] is a subset of [1, 2, 3], but [1, 4] is not.- Specified by:
isSubsetOfin interfaceSetIterable<T>
-
isProperSubsetOf
Description copied from interface:SetIterableReturns true if all the members ofthisare also members ofcandidateSupersetand the two sets are not equal. For example, [1, 2] is a proper subset of [1, 2, 3], but [1, 2, 3] is not.- Specified by:
isProperSubsetOfin interfaceSetIterable<T>
-
powerSet
Description copied from interface:UnsortedSetIterableReturns the set whose members are all possible subsets ofthis. For example, the powerset of [1, 2] is [[], [1], [2], [1, 2]].- Specified by:
powerSetin interfaceMutableSet<T>- Specified by:
powerSetin interfaceUnsortedSetIterable<T>
-
cartesianProduct
Description copied from interface:SetIterableReturns the set whose members are all possible ordered pairs (a, b) where a is a member ofthisand b is a member ofset.- Specified by:
cartesianProductin interfaceSetIterable<T>
-