Top Fields Constructors Methods
org.eclipse.collections.impl.collection.mutable

public abstract Class AbstractSynchronizedMutableCollection<T>

extends AbstractSynchronizedRichIterable<T>
implements MutableCollection<T>
Class Inheritance
All Implemented Interfaces
org.eclipse.collections.api.collection.MutableCollection, org.eclipse.collections.api.RichIterable, org.eclipse.collections.api.InternalIterable, java.lang.Iterable, java.util.Collection
Known Direct Subclasses
org.eclipse.collections.impl.collection.mutable.SynchronizedMutableCollection, org.eclipse.collections.impl.list.mutable.SynchronizedMutableList, org.eclipse.collections.impl.set.mutable.SynchronizedMutableSet, org.eclipse.collections.impl.set.sorted.mutable.SynchronizedSortedSet, org.eclipse.collections.impl.bag.mutable.SynchronizedBag, org.eclipse.collections.impl.bag.sorted.mutable.SynchronizedSortedBag
Imports
java.util.Collection, org.eclipse.collections.api.bag.MutableBag, org.eclipse.collections.api.block.function.Function, .Function0, .Function2, .Function3, org.eclipse.collections.api.block.function.primitive.BooleanFunction, .ByteFunction, .CharFunction, .DoubleFunction, .FloatFunction, .IntFunction, .LongFunction, .ShortFunction, org.eclipse.collections.api.block.predicate.Predicate, .Predicate2, org.eclipse.collections.api.block.procedure.Procedure, .Procedure2, org.eclipse.collections.api.collection.MutableCollection, org.eclipse.collections.api.collection.primitive.MutableBooleanCollection, .MutableByteCollection, .MutableCharCollection, .MutableDoubleCollection, .MutableFloatCollection, .MutableIntCollection, .MutableLongCollection, .MutableShortCollection, org.eclipse.collections.api.list.MutableList, org.eclipse.collections.api.map.MutableMap, org.eclipse.collections.api.map.primitive.MutableObjectDoubleMap, .MutableObjectLongMap, org.eclipse.collections.api.multimap.MutableMultimap, org.eclipse.collections.api.partition.PartitionMutableCollection, org.eclipse.collections.api.tuple.Pair, .Twin, org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable

Field Summary

Inherited from org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable:
delegatelock

Constructor Summary

AccessConstructor and Description
protected
protected

Method Summary

Modifier and TypeMethod and Description
public boolean
add(T o)

Implements java.util.Collection.add.

Ensures that this collection contains the specified element (optional operation).

public boolean
addAll(Collection<? extends T> coll)

Implements java.util.Collection.addAll.

Adds all of the elements in the specified collection to this collection (optional operation).

public boolean
public <K, V> MutableMap<K, V>
aggregateBy(Function<? super T, ? extends K> groupBy, Function0<? extends V> zeroValueFactory, Function2<? super V, ? super T, ? extends V> nonMutatingAggregator)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.aggregateBy.

Overrides default org.eclipse.collections.api.collection.MutableCollection.aggregateBy, org.eclipse.collections.api.RichIterable.aggregateBy.

Applies an aggregate function over the iterable grouping results into a map based on the specific groupBy function.

public <K, V> MutableMap<K, V>
aggregateInPlaceBy(Function<? super T, ? extends K> groupBy, Function0<? extends V> zeroValueFactory, Procedure2<? super V, ? super T> mutatingAggregator)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.aggregateInPlaceBy.

Overrides default org.eclipse.collections.api.collection.MutableCollection.aggregateInPlaceBy, org.eclipse.collections.api.RichIterable.aggregateInPlaceBy.

Applies an aggregate procedure over the iterable grouping results into a Map based on the specific groupBy function.

public void
clear()

Implements java.util.Collection.clear.

Removes all of the elements from this collection (optional operation).

public <V> MutableCollection<V>
collect(Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.collect.

Implements org.eclipse.collections.api.collection.MutableCollection.collect, org.eclipse.collections.api.RichIterable.collect.

Returns a new MutableCollection with the results of applying the specified function to each element of the source collection.

public MutableBooleanCollection
collectBoolean(BooleanFunction<? super T> booleanFunction)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.collectBoolean.

Overrides default org.eclipse.collections.api.collection.MutableCollection.collectBoolean.

Implements org.eclipse.collections.api.RichIterable.collectBoolean.

Returns a new primitive boolean iterable with the results of applying the specified function on each element of the source collection.

public MutableByteCollection
collectByte(ByteFunction<? super T> byteFunction)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.collectByte.

Overrides default org.eclipse.collections.api.collection.MutableCollection.collectByte.

Implements org.eclipse.collections.api.RichIterable.collectByte.

Returns a new primitive byte iterable with the results of applying the specified function on each element of the source collection.

public MutableCharCollection
collectChar(CharFunction<? super T> charFunction)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.collectChar.

Overrides default org.eclipse.collections.api.collection.MutableCollection.collectChar.

Implements org.eclipse.collections.api.RichIterable.collectChar.

Returns a new primitive char iterable with the results of applying the specified function on each element of the source collection.

public MutableDoubleCollection
collectDouble(DoubleFunction<? super T> doubleFunction)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.collectDouble.

Overrides default org.eclipse.collections.api.collection.MutableCollection.collectDouble.

Implements org.eclipse.collections.api.RichIterable.collectDouble.

Returns a new primitive double iterable with the results of applying the specified function on each element of the source collection.

public MutableFloatCollection
collectFloat(FloatFunction<? super T> floatFunction)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.collectFloat.

Overrides default org.eclipse.collections.api.collection.MutableCollection.collectFloat.

Implements org.eclipse.collections.api.RichIterable.collectFloat.

Returns a new primitive float iterable with the results of applying the specified function on each element of the source collection.

public <V> MutableCollection<V>
collectIf(Predicate<? super T> predicate, Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.collectIf.

Implements org.eclipse.collections.api.collection.MutableCollection.collectIf, org.eclipse.collections.api.RichIterable.collectIf.

Returns a new MutableCollection with the results of applying the specified function to each element of the source collection, but only for elements that evaluate to true for the specified predicate.

public MutableIntCollection
collectInt(IntFunction<? super T> intFunction)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.collectInt.

Overrides default org.eclipse.collections.api.collection.MutableCollection.collectInt.

Implements org.eclipse.collections.api.RichIterable.collectInt.

Returns a new primitive int iterable with the results of applying the specified function on each element of the source collection.

public MutableLongCollection
collectLong(LongFunction<? super T> longFunction)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.collectLong.

Overrides default org.eclipse.collections.api.collection.MutableCollection.collectLong.

Implements org.eclipse.collections.api.RichIterable.collectLong.

Returns a new primitive long iterable with the results of applying the specified function on each element of the source collection.

public MutableShortCollection
collectShort(ShortFunction<? super T> shortFunction)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.collectShort.

Overrides default org.eclipse.collections.api.collection.MutableCollection.collectShort.

Implements org.eclipse.collections.api.RichIterable.collectShort.

Returns a new primitive short iterable with the results of applying the specified function on each element of the source collection.

public <P, V> MutableCollection<V>
collectWith(Function2<? super T, ? super P, ? extends V> function, P parameter)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.collectWith.

Implements org.eclipse.collections.api.collection.MutableCollection.collectWith, org.eclipse.collections.api.RichIterable.collectWith.

Same as collect(Function) with a Function2 and specified parameter which is passed to the block.

public <V> MutableBag<V>
countBy(Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.countBy.

Overrides default org.eclipse.collections.api.collection.MutableCollection.countBy, org.eclipse.collections.api.RichIterable.countBy.

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<V>
countByEach(Function<? super T, ? extends Iterable<V>> function)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.countByEach.

Overrides default org.eclipse.collections.api.collection.MutableCollection.countByEach, org.eclipse.collections.api.RichIterable.countByEach.

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<V>
countByWith(Function2<? super T, ? super P, ? extends V> function, P parameter)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.countByWith.

Overrides default org.eclipse.collections.api.collection.MutableCollection.countByWith, org.eclipse.collections.api.RichIterable.countByWith.

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 <V> MutableCollection<V>
protected MutableCollection<T>
public <V> MutableMultimap<V, T>
groupBy(Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.groupBy.

Implements org.eclipse.collections.api.collection.MutableCollection.groupBy, org.eclipse.collections.api.RichIterable.groupBy.

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> MutableMultimap<V, T>
groupByEach(Function<? super T, ? extends Iterable<V>> function)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.groupByEach.

Implements org.eclipse.collections.api.collection.MutableCollection.groupByEach, org.eclipse.collections.api.RichIterable.groupByEach.

Similar to groupBy(Function), except the result of evaluating function will return a collection of keys for each value.

public <V> MutableMap<V, T>
groupByUniqueKey(Function<? super T, ? extends V> function)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.groupByUniqueKey.

Overrides default org.eclipse.collections.api.collection.MutableCollection.groupByUniqueKey.

Implements org.eclipse.collections.api.RichIterable.groupByUniqueKey.

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 <IV, P> IV
injectIntoWith(IV injectValue, Function3<? super IV, ? super T, ? super P, ? extends IV> function, P parameter)

Implements org.eclipse.collections.api.collection.MutableCollection.injectIntoWith.

Returns the final result of evaluating function using each element of the iterable, the previous evaluation result and the parameters.

public PartitionMutableCollection<T>
public <P> PartitionMutableCollection<T>
partitionWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.partitionWith.

Implements org.eclipse.collections.api.collection.MutableCollection.partitionWith, org.eclipse.collections.api.RichIterable.partitionWith.

Filters a collection into a PartitionIterable based on the evaluation of the predicate.

public MutableCollection<T>
reject(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.reject.

Implements org.eclipse.collections.api.collection.MutableCollection.reject, org.eclipse.collections.api.RichIterable.reject.

Returns a MutableCollection with all elements that evaluate to false for the specified predicate.

public <P> MutableCollection<T>
rejectWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.rejectWith.

Implements org.eclipse.collections.api.collection.MutableCollection.rejectWith, org.eclipse.collections.api.RichIterable.rejectWith.

Returns a MutableCollection with all elements that evaluate to false for the specified predicate2 and parameter.

public boolean
remove(Object o)

Implements java.util.Collection.remove.

Removes a single instance of the specified element from this collection, if it is present (optional operation).

public boolean
removeAll(Collection<?> coll)

Implements java.util.Collection.removeAll.

Removes all of this collection's elements that are also contained in the specified collection (optional operation).

public boolean
public boolean
removeIf(Predicate<? super T> predicate)

Implements org.eclipse.collections.api.collection.MutableCollection.removeIf.

Removes all elements in the collection that evaluate to true for the specified predicate.

public <P> boolean
removeIfWith(Predicate2<? super T, ? super P> predicate, P parameter)

Implements org.eclipse.collections.api.collection.MutableCollection.removeIfWith.

Removes all elements in the collection that evaluate to true for the specified predicate2 and parameter.

public boolean
retainAll(Collection<?> coll)

Implements java.util.Collection.retainAll.

Retains only the elements in this collection that are contained in the specified collection (optional operation).

public boolean
public MutableCollection<T>
select(Predicate<? super T> predicate)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.select.

Implements org.eclipse.collections.api.collection.MutableCollection.select, org.eclipse.collections.api.RichIterable.select.

Returns a MutableCollection with all elements that evaluate to true for the specified predicate.

public <P> Twin<MutableList<T>>
selectAndRejectWith(Predicate2<? super T, ? super P> predicate, P parameter)

Implements org.eclipse.collections.api.collection.MutableCollection.selectAndRejectWith.

Filters a collection into two separate collections based on a predicate returned via a Pair.

public <S> MutableCollection<S>
public <P> MutableCollection<T>
selectWith(Predicate2<? super T, ? super P> predicate, P parameter)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.selectWith.

Implements org.eclipse.collections.api.collection.MutableCollection.selectWith, org.eclipse.collections.api.RichIterable.selectWith.

Returns a MutableCollection with all elements that evaluate to true for the specified predicate2 and parameter.

public <V> MutableObjectDoubleMap<V>
public <V> MutableObjectDoubleMap<V>
public <V> MutableObjectLongMap<V>
public <V> MutableObjectLongMap<V>
public MutableCollection<T>
public <S> MutableCollection<Pair<T, S>>
zip(Iterable<S> that)

Overrides org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable.zip.

Implements org.eclipse.collections.api.collection.MutableCollection.zip, org.eclipse.collections.api.RichIterable.zip.

Returns a RichIterable formed from this RichIterable and another RichIterable by combining corresponding elements in pairs.

public MutableCollection<Pair<T, Integer>>
Inherited from org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable:
allSatisfyallSatisfyWithanySatisfyanySatisfyWithappendStringappendStringappendStringasLazychunkcollectcollectBooleancollectBytecollectCharcollectDoublecollectFloatcollectIfcollectIntcollectLongcollectShortcollectWithcontainscontainsAllcontainsAllArgumentscontainsAllIterablecontainsAnycontainsAnyIterablecontainsNonecontainsNoneIterablecountcountBycountByEachcountByWithcountWithdetectdetectIfNonedetectOptionaldetectWithdetectWithIfNonedetectWithOptionaleachequalsflatCollectflatCollectBooleanflatCollectByteflatCollectCharflatCollectDoubleflatCollectFloatflatCollectIntflatCollectLongflatCollectShortforEachWithforEachWithIndexgetFirstgetLastgetLockgetOnlygroupBygroupByEachgroupByUniqueKeyhashCodeinjectIntoinjectIntoinjectIntoinjectIntoinjectIntointoisEmptyiteratormakeStringmakeStringmakeStringmakeStringmaxmaxmaxBymaxByOptionalmaxOptionalmaxOptionalminminminByminByOptionalminOptionalminOptionalnoneSatisfynoneSatisfyWithnotEmptyreduceByrejectrejectWithselectselectWithsizesumOfDoublesumOfFloatsumOfIntsumOfLongtoArraytoArraytoBagtoBiMaptoImmutableBagtoImmutableListtoImmutableSettoImmutableSortedBagtoImmutableSortedBagtoImmutableSortedBagBytoImmutableSortedListtoImmutableSortedListtoImmutableSortedSettoImmutableSortedSettoImmutableSortedSetBytoListtoMaptoMaptoSettoSortedBagtoSortedBagtoSortedListtoSortedListtoSortedListBytoSortedMaptoSortedMaptoSortedMapBytoSortedSettoSortedSettoStringzipzipWithIndex