Class SynchronizedMutableCollection<T>
- java.lang.Object
-
- org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable<T>
-
- org.eclipse.collections.impl.collection.mutable.AbstractSynchronizedMutableCollection<T>
-
- org.eclipse.collections.impl.collection.mutable.SynchronizedMutableCollection<T>
-
- All Implemented Interfaces:
Serializable
,Iterable<T>
,Collection<T>
,MutableCollection<T>
,InternalIterable<T>
,RichIterable<T>
public class SynchronizedMutableCollection<T> extends AbstractSynchronizedMutableCollection<T> implements Serializable
A synchronized view of aMutableCollection
. It is imperative that the user manually synchronize on the collection when iterating over it using the standard JDK iterator or JDK 5 for loop, as perCollections.synchronizedCollection(Collection)
.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MutableCollection<T>
asSynchronized()
MutableCollection<T>
asUnmodifiable()
MutableCollection<T>
newEmpty()
static <E,C extends Collection<E>>
SynchronizedMutableCollection<E>of(C collection)
This method will take a MutableCollection and wrap it directly in a SynchronizedMutableCollection.static <E,C extends Collection<E>>
SynchronizedMutableCollection<E>of(C collection, Object lock)
This method will take a MutableCollection and wrap it directly in a SynchronizedMutableCollection.ImmutableCollection<T>
toImmutable()
MutableCollection<T>
with(T element)
MutableCollection<T>
withAll(Iterable<? extends T> elements)
MutableCollection<T>
without(T element)
MutableCollection<T>
withoutAll(Iterable<? extends T> elements)
-
Methods inherited from class org.eclipse.collections.impl.collection.mutable.AbstractSynchronizedMutableCollection
add, addAll, addAllIterable, aggregateBy, aggregateInPlaceBy, clear, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, countBy, countByEach, countByWith, flatCollect, groupBy, groupByEach, groupByUniqueKey, injectIntoWith, partition, partitionWith, reject, rejectWith, remove, removeAll, removeAllIterable, removeIf, removeIfWith, retainAll, retainAllIterable, select, selectAndRejectWith, selectInstancesOf, selectWith, sumByDouble, sumByFloat, sumByInt, sumByLong, tap, zip, zipWithIndex
-
Methods inherited from class org.eclipse.collections.impl.collection.AbstractSynchronizedRichIterable
allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, containsAny, containsAnyIterable, containsNone, containsNoneIterable, count, countBy, countByEach, countByWith, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, equals, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, forEachWith, forEachWithIndex, getFirst, getLast, getOnly, groupBy, groupByEach, groupByUniqueKey, hashCode, injectInto, injectInto, injectInto, injectInto, injectInto, into, isEmpty, iterator, makeString, makeString, makeString, makeString, max, max, maxBy, maxByOptional, maxOptional, maxOptional, min, min, minBy, minByOptional, minOptional, minOptional, noneSatisfy, noneSatisfyWith, notEmpty, reject, rejectWith, select, selectWith, size, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toBiMap, toImmutableBag, toImmutableList, toImmutableSet, toImmutableSortedBag, toImmutableSortedBag, toImmutableSortedBagBy, toImmutableSortedList, toImmutableSortedList, toImmutableSortedSet, toImmutableSortedSet, toImmutableSortedSetBy, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toString, zip, zipWithIndex
-
Methods inherited from interface java.util.Collection
contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, removeIf, size, spliterator, stream, toArray, toArray, toArray
-
Methods inherited from interface org.eclipse.collections.api.InternalIterable
forEach, forEachWith, forEachWithIndex
-
Methods inherited from interface org.eclipse.collections.api.collection.MutableCollection
flatCollectWith
-
Methods inherited from interface org.eclipse.collections.api.RichIterable
aggregateBy, allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, containsAny, containsAnyIterable, containsBy, containsNone, containsNoneIterable, count, countBy, countByEach, countByWith, countWith, detect, detectIfNone, detectOptional, 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, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, into, isEmpty, makeString, makeString, makeString, makeString, max, max, maxBy, maxByOptional, maxOptional, maxOptional, min, min, minBy, minByOptional, minOptional, minOptional, noneSatisfy, noneSatisfyWith, notEmpty, reduce, reduceInPlace, reduceInPlace, reject, rejectWith, select, selectWith, size, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toBiMap, toImmutableBag, toImmutableBiMap, toImmutableList, toImmutableMap, toImmutableSet, toImmutableSortedBag, toImmutableSortedBag, toImmutableSortedBagBy, toImmutableSortedList, toImmutableSortedList, toImmutableSortedListBy, toImmutableSortedSet, toImmutableSortedSet, toImmutableSortedSetBy, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedBagBy, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedMapBy, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndex
-
-
-
-
Method Detail
-
of
public static <E,C extends Collection<E>> SynchronizedMutableCollection<E> of(C collection)
This method will take a MutableCollection and wrap it directly in a SynchronizedMutableCollection. It will take any other non-Eclipse-Collections collection and first adapt it will a CollectionAdapter, and then return a SynchronizedMutableCollection that wraps the adapter.
-
of
public static <E,C extends Collection<E>> SynchronizedMutableCollection<E> of(C collection, Object lock)
This method will take a MutableCollection and wrap it directly in a SynchronizedMutableCollection. It will take any other non-Eclipse-Collections collection and first adapt it will a CollectionAdapter, and then return a SynchronizedMutableCollection that wraps the adapter. Additionally, a developer specifies which lock to use with the collection.
-
with
public MutableCollection<T> with(T element)
- Specified by:
with
in interfaceMutableCollection<T>
-
without
public MutableCollection<T> without(T element)
- Specified by:
without
in interfaceMutableCollection<T>
-
withAll
public MutableCollection<T> withAll(Iterable<? extends T> elements)
- Specified by:
withAll
in interfaceMutableCollection<T>
-
withoutAll
public MutableCollection<T> withoutAll(Iterable<? extends T> elements)
- Specified by:
withoutAll
in interfaceMutableCollection<T>
-
asUnmodifiable
public MutableCollection<T> asUnmodifiable()
- Specified by:
asUnmodifiable
in interfaceMutableCollection<T>
-
asSynchronized
public MutableCollection<T> asSynchronized()
- Specified by:
asSynchronized
in interfaceMutableCollection<T>
-
toImmutable
public ImmutableCollection<T> toImmutable()
- Specified by:
toImmutable
in interfaceMutableCollection<T>
-
newEmpty
public MutableCollection<T> newEmpty()
- Specified by:
newEmpty
in interfaceMutableCollection<T>
-
-