Class MultiReaderUnifiedSet<T>
java.lang.Object
org.eclipse.collections.impl.collection.mutable.AbstractMultiReaderMutableCollection<T>
org.eclipse.collections.impl.set.mutable.MultiReaderUnifiedSet<T>
- All Implemented Interfaces:
Externalizable,Serializable,Cloneable,Iterable<T>,Collection<T>,RandomAccess,Set<T>,MutableCollection<T>,InternalIterable<T>,RichIterable<T>,MultiReaderSet<T>,MutableSet<T>,MutableSetIterable<T>,SetIterable<T>,UnsortedSetIterable<T>
public final class MultiReaderUnifiedSet<T>
extends AbstractMultiReaderMutableCollection<T>
implements RandomAccess, Externalizable, MultiReaderSet<T>
MultiReadUnifiedSet provides a thread-safe wrapper around a UnifiedSet, using a ReentrantReadWriteLock. In order to
provide true thread-safety, MultiReaderUnifiedSet does not implement
iterator() as this method requires an external
lock to be taken to provide thread-safe iteration. You can use an iterator() if you use the
withReadLockAndDelegate() or withWriteLockAndDelegate() methods. Both of these methods take a parameter of type
Procedure<MutableSet>, and a wrapped version of the underlying Unified is returned. This wrapper guarantees that no
external pointer can ever reference the underlying UnifiedSet outside a locked procedure. In the case of the read
lock method, an Unmodifiable version of the collection is offered, which will throw UnsupportedOperationExceptions on
any write methods like add or remove.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.collections.impl.collection.mutable.AbstractMultiReaderMutableCollection
AbstractMultiReaderMutableCollection.LockWrapper, AbstractMultiReaderMutableCollection.ReadWriteLockWrapper -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Empty default constructor used for serialization. -
Method Summary
Modifier and TypeMethodDescriptionasParallel(ExecutorService executorService, int batchSize) <B> LazyIterable<Pair<T,B>> cartesianProduct(SetIterable<B> set) chunk(int size) clone()<V> MutableSet<V>collectBoolean(BooleanFunction<? super T> booleanFunction) collectByte(ByteFunction<? super T> byteFunction) collectChar(CharFunction<? super T> charFunction) collectDouble(DoubleFunction<? super T> doubleFunction) collectFloat(FloatFunction<? super T> floatFunction) <V> MutableSet<V>collectInt(IntFunction<? super T> intFunction) collectLong(LongFunction<? super T> longFunction) collectShort(ShortFunction<? super T> shortFunction) <P,V> MutableSet<V> collectWith(Function2<? super T, ? super P, ? extends V> function, P parameter) difference(SetIterable<? extends T> subtrahendSet) differenceInto(SetIterable<? extends T> subtrahendSet, R targetSet) boolean<V> MutableSet<V>flatCollect(Function<? super T, ? extends Iterable<V>> function) <V> MutableSetMultimap<V,T> <V> MutableSetMultimap<V,T> groupByEach(Function<? super T, ? extends Iterable<V>> function) <V> MutableMap<V,T> groupByUniqueKey(Function<? super T, ? extends V> function) inthashCode()intersect(SetIterable<? extends T> set) intersectInto(SetIterable<? extends T> set, R targetSet) booleanisProperSubsetOf(SetIterable<? extends T> candidateSuperset) booleanisSubsetOf(SetIterable<? extends T> candidateSuperset) newEmpty()static <T> MultiReaderUnifiedSet<T>newSet()static <T> MultiReaderUnifiedSet<T>newSet(int capacity) static <T> MultiReaderUnifiedSet<T>static <T> MultiReaderUnifiedSet<T>newSetWith(T... elements) <P> PartitionMutableSet<T>partitionWith(Predicate2<? super T, ? super P> predicate, P parameter) powerSet()void<P> MutableSet<T>rejectWith(Predicate2<? super T, ? super P> predicate, P parameter) <S> MutableSet<S>selectInstancesOf(Class<S> clazz) <P> MutableSet<T>selectWith(Predicate2<? super T, ? super P> predicate, P parameter) symmetricDifference(SetIterable<? extends T> setB) symmetricDifferenceInto(SetIterable<? extends T> set, R targetSet) union(SetIterable<? extends T> set) unionInto(SetIterable<? extends T> set, R targetSet) voidwithReadLockAndDelegate(Procedure<? super MutableSet<T>> procedure) voidwithWriteLockAndDelegate(Procedure<? super MutableSet<T>> procedure) void<S> MutableSet<Pair<T,S>> Deprecated.in 6.0.Deprecated.in 6.0.Methods inherited from class org.eclipse.collections.impl.collection.mutable.AbstractMultiReaderMutableCollection
add, addAll, addAllIterable, aggregateInPlaceBy, allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, clear, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectIf, collectInt, collectLong, collectShort, collectWith, contains, containsAll, containsAllArguments, containsAllIterable, count, countWith, detect, detectIfNone, detectOptional, detectWith, detectWithIfNone, detectWithOptional, each, flatCollect, flatCollectBoolean, flatCollectByte, flatCollectChar, flatCollectDouble, flatCollectFloat, flatCollectInt, flatCollectLong, flatCollectShort, forEachWith, forEachWithIndex, getFirst, getLast, getOnly, groupBy, groupByEach, groupByUniqueKey, injectInto, injectInto, injectInto, injectInto, injectInto, injectIntoWith, into, isEmpty, iterator, makeString, makeString, makeString, makeString, max, max, maxBy, maxByOptional, maxOptional, maxOptional, min, min, minBy, minByOptional, minOptional, minOptional, noneSatisfy, noneSatisfyWith, notEmpty, parallelStream, reduceBy, reduceBy, reject, rejectWith, remove, removeAll, removeAllIterable, removeIf, removeIfWith, retainAll, retainAllIterable, select, selectAndRejectWith, selectWith, size, spliterator, stream, sumByDouble, sumByFloat, sumByInt, sumByLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toArray, toArray, toBag, toBiMap, toImmutableBag, toImmutableList, toImmutableSet, toImmutableSortedBag, toImmutableSortedBag, toImmutableSortedBagBy, toImmutableSortedList, toImmutableSortedList, toImmutableSortedListBy, toImmutableSortedSet, toImmutableSortedSet, toImmutableSortedSetBy, toList, toMap, toMap, toSet, toSortedBag, toSortedBag, toSortedList, toSortedList, toSortedListBy, toSortedMap, toSortedMap, toSortedSet, toSortedSet, toSortedSetBy, toString, zip, zipWithIndexMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface org.eclipse.collections.api.InternalIterable
forEach, forEachWith, forEachWithIndexMethods inherited from interface org.eclipse.collections.api.set.MultiReaderSet
with, withAll, without, withoutAllMethods inherited from interface org.eclipse.collections.api.collection.MutableCollection
addAllIterable, aggregateBy, aggregateInPlaceBy, countBy, countByEach, countByWith, flatCollectWith, injectIntoWith, removeAllIterable, removeIf, removeIfWith, retainAllIterable, selectAndRejectWith, sumByDouble, sumByFloat, sumByInt, sumByLongMethods inherited from interface org.eclipse.collections.api.set.MutableSet
flatCollectWith, toImmutableSetMethods inherited from interface org.eclipse.collections.api.set.MutableSetIterable
toArray, toArrayMethods inherited from interface org.eclipse.collections.api.RichIterable
aggregateBy, allSatisfy, allSatisfyWith, anySatisfy, anySatisfyWith, appendString, appendString, appendString, asLazy, 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, reduceBy, reduceBy, reduceInPlace, reduceInPlace, reject, rejectWith, select, selectWith, size, summarizeDouble, summarizeFloat, summarizeInt, summarizeLong, sumOfDouble, sumOfFloat, sumOfInt, sumOfLong, toBag, toBiMap, toImmutableBag, toImmutableBiMap, toImmutableList, toImmutableMap, 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
-
Constructor Details
-
MultiReaderUnifiedSet
Deprecated.Empty default constructor used for serialization.
-
-
Method Details
-
newSet
-
newSet
-
newSet
-
newSetWith
-
withReadLockAndDelegate
- Specified by:
withReadLockAndDelegatein interfaceMultiReaderSet<T>
-
withWriteLockAndDelegate
- Specified by:
withWriteLockAndDelegatein interfaceMultiReaderSet<T>
-
asSynchronized
- Specified by:
asSynchronizedin interfaceMutableCollection<T>- Specified by:
asSynchronizedin interfaceMutableSet<T>
-
toImmutable
- Specified by:
toImmutablein interfaceMutableCollection<T>- Specified by:
toImmutablein interfaceMutableSet<T>- Specified by:
toImmutablein interfaceSetIterable<T>- Specified by:
toImmutablein interfaceUnsortedSetIterable<T>
-
asUnmodifiable
- Specified by:
asUnmodifiablein interfaceMutableCollection<T>- Specified by:
asUnmodifiablein interfaceMutableSet<T>
-
clone
- Specified by:
clonein interfaceMultiReaderSet<T>- Specified by:
clonein interfaceMutableSet<T>
-
collect
- Specified by:
collectin interfaceMutableCollection<T>- Specified by:
collectin interfaceMutableSet<T>- Specified by:
collectin interfaceRichIterable<T>- Specified by:
collectin interfaceUnsortedSetIterable<T>
-
collectBoolean
- Specified by:
collectBooleanin interfaceMutableCollection<T>- Specified by:
collectBooleanin interfaceMutableSet<T>- Specified by:
collectBooleanin interfaceRichIterable<T>- Specified by:
collectBooleanin interfaceUnsortedSetIterable<T>
-
collectByte
- Specified by:
collectBytein interfaceMutableCollection<T>- Specified by:
collectBytein interfaceMutableSet<T>- Specified by:
collectBytein interfaceRichIterable<T>- Specified by:
collectBytein interfaceUnsortedSetIterable<T>
-
collectChar
- Specified by:
collectCharin interfaceMutableCollection<T>- Specified by:
collectCharin interfaceMutableSet<T>- Specified by:
collectCharin interfaceRichIterable<T>- Specified by:
collectCharin interfaceUnsortedSetIterable<T>
-
collectDouble
- Specified by:
collectDoublein interfaceMutableCollection<T>- Specified by:
collectDoublein interfaceMutableSet<T>- Specified by:
collectDoublein interfaceRichIterable<T>- Specified by:
collectDoublein interfaceUnsortedSetIterable<T>
-
collectFloat
- Specified by:
collectFloatin interfaceMutableCollection<T>- Specified by:
collectFloatin interfaceMutableSet<T>- Specified by:
collectFloatin interfaceRichIterable<T>- Specified by:
collectFloatin interfaceUnsortedSetIterable<T>
-
collectInt
- Specified by:
collectIntin interfaceMutableCollection<T>- Specified by:
collectIntin interfaceMutableSet<T>- Specified by:
collectIntin interfaceRichIterable<T>- Specified by:
collectIntin interfaceUnsortedSetIterable<T>
-
collectLong
- Specified by:
collectLongin interfaceMutableCollection<T>- Specified by:
collectLongin interfaceMutableSet<T>- Specified by:
collectLongin interfaceRichIterable<T>- Specified by:
collectLongin interfaceUnsortedSetIterable<T>
-
collectShort
- Specified by:
collectShortin interfaceMutableCollection<T>- Specified by:
collectShortin interfaceMutableSet<T>- Specified by:
collectShortin interfaceRichIterable<T>- Specified by:
collectShortin interfaceUnsortedSetIterable<T>
-
flatCollect
- Specified by:
flatCollectin interfaceMutableCollection<T>- Specified by:
flatCollectin interfaceMutableSet<T>- Specified by:
flatCollectin interfaceRichIterable<T>- Specified by:
flatCollectin interfaceUnsortedSetIterable<T>
-
collectIf
public <V> MutableSet<V> collectIf(Predicate<? super T> predicate, Function<? super T, ? extends V> function) - Specified by:
collectIfin interfaceMutableCollection<T>- Specified by:
collectIfin interfaceMutableSet<T>- Specified by:
collectIfin interfaceRichIterable<T>- Specified by:
collectIfin interfaceUnsortedSetIterable<T>
-
collectWith
public <P,V> MutableSet<V> collectWith(Function2<? super T, ? super P, ? extends V> function, P parameter) - Specified by:
collectWithin interfaceMutableCollection<T>- Specified by:
collectWithin interfaceMutableSet<T>- Specified by:
collectWithin interfaceRichIterable<T>- Specified by:
collectWithin interfaceUnsortedSetIterable<T>
-
newEmpty
- Specified by:
newEmptyin interfaceMultiReaderSet<T>- Specified by:
newEmptyin interfaceMutableCollection<T>- Specified by:
newEmptyin interfaceMutableSet<T>
-
reject
- Specified by:
rejectin interfaceMutableCollection<T>- Specified by:
rejectin interfaceMutableSet<T>- Specified by:
rejectin interfaceMutableSetIterable<T>- Specified by:
rejectin interfaceRichIterable<T>- Specified by:
rejectin interfaceSetIterable<T>- Specified by:
rejectin interfaceUnsortedSetIterable<T>
-
rejectWith
- Specified by:
rejectWithin interfaceMutableCollection<T>- Specified by:
rejectWithin interfaceMutableSet<T>- Specified by:
rejectWithin interfaceMutableSetIterable<T>- Specified by:
rejectWithin interfaceRichIterable<T>- Specified by:
rejectWithin interfaceSetIterable<T>- Specified by:
rejectWithin interfaceUnsortedSetIterable<T>
-
tap
- Specified by:
tapin interfaceMultiReaderSet<T>- Specified by:
tapin interfaceMutableCollection<T>- Specified by:
tapin interfaceMutableSet<T>- Specified by:
tapin interfaceMutableSetIterable<T>- Specified by:
tapin interfaceRichIterable<T>- Specified by:
tapin interfaceSetIterable<T>- Specified by:
tapin interfaceUnsortedSetIterable<T>
-
select
- Specified by:
selectin interfaceMutableCollection<T>- Specified by:
selectin interfaceMutableSet<T>- Specified by:
selectin interfaceMutableSetIterable<T>- Specified by:
selectin interfaceRichIterable<T>- Specified by:
selectin interfaceSetIterable<T>- Specified by:
selectin interfaceUnsortedSetIterable<T>
-
selectWith
- Specified by:
selectWithin interfaceMutableCollection<T>- Specified by:
selectWithin interfaceMutableSet<T>- Specified by:
selectWithin interfaceMutableSetIterable<T>- Specified by:
selectWithin interfaceRichIterable<T>- Specified by:
selectWithin interfaceSetIterable<T>- Specified by:
selectWithin interfaceUnsortedSetIterable<T>
-
partition
- Specified by:
partitionin interfaceMutableCollection<T>- Specified by:
partitionin interfaceMutableSet<T>- Specified by:
partitionin interfaceMutableSetIterable<T>- Specified by:
partitionin interfaceRichIterable<T>- Specified by:
partitionin interfaceSetIterable<T>
-
partitionWith
public <P> PartitionMutableSet<T> partitionWith(Predicate2<? super T, ? super P> predicate, P parameter) - Specified by:
partitionWithin interfaceMutableCollection<T>- Specified by:
partitionWithin interfaceMutableSet<T>- Specified by:
partitionWithin interfaceMutableSetIterable<T>- Specified by:
partitionWithin interfaceRichIterable<T>- Specified by:
partitionWithin interfaceSetIterable<T>
-
selectInstancesOf
- Specified by:
selectInstancesOfin interfaceMutableCollection<T>- Specified by:
selectInstancesOfin interfaceMutableSet<T>- Specified by:
selectInstancesOfin interfaceMutableSetIterable<T>- Specified by:
selectInstancesOfin interfaceRichIterable<T>- Specified by:
selectInstancesOfin interfaceSetIterable<T>- Specified by:
selectInstancesOfin interfaceUnsortedSetIterable<T>
-
equals
-
hashCode
public int hashCode() -
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-
groupBy
- Specified by:
groupByin interfaceMutableCollection<T>- Specified by:
groupByin interfaceMutableSet<T>- Specified by:
groupByin interfaceMutableSetIterable<T>- Specified by:
groupByin interfaceRichIterable<T>- Specified by:
groupByin interfaceUnsortedSetIterable<T>
-
groupByEach
- Specified by:
groupByEachin interfaceMutableCollection<T>- Specified by:
groupByEachin interfaceMutableSet<T>- Specified by:
groupByEachin interfaceMutableSetIterable<T>- Specified by:
groupByEachin interfaceRichIterable<T>- Specified by:
groupByEachin interfaceUnsortedSetIterable<T>
-
groupByUniqueKey
- Specified by:
groupByUniqueKeyin interfaceMutableCollection<T>- Specified by:
groupByUniqueKeyin interfaceRichIterable<T>
-
zip
Deprecated.in 6.0. UseOrderedIterable.zip(Iterable)instead.- 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>
-
zipWithIndex
Deprecated.in 6.0. UseOrderedIterable.zipWithIndex()instead.- 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>
-
chunk
- Specified by:
chunkin interfaceRichIterable<T>
-
union
- Specified by:
unionin interfaceMutableSet<T>- Specified by:
unionin interfaceSetIterable<T>- Specified by:
unionin interfaceUnsortedSetIterable<T>
-
unionInto
- Specified by:
unionIntoin interfaceSetIterable<T>
-
intersect
- Specified by:
intersectin interfaceMutableSet<T>- Specified by:
intersectin interfaceSetIterable<T>- Specified by:
intersectin interfaceUnsortedSetIterable<T>
-
intersectInto
- Specified by:
intersectIntoin interfaceSetIterable<T>
-
difference
- Specified by:
differencein interfaceMutableSet<T>- Specified by:
differencein interfaceSetIterable<T>- Specified by:
differencein interfaceUnsortedSetIterable<T>
-
differenceInto
- Specified by:
differenceIntoin interfaceSetIterable<T>
-
symmetricDifference
- Specified by:
symmetricDifferencein interfaceMutableSet<T>- Specified by:
symmetricDifferencein interfaceSetIterable<T>- Specified by:
symmetricDifferencein interfaceUnsortedSetIterable<T>
-
symmetricDifferenceInto
- Specified by:
symmetricDifferenceIntoin interfaceSetIterable<T>
-
isSubsetOf
- Specified by:
isSubsetOfin interfaceSetIterable<T>
-
isProperSubsetOf
- Specified by:
isProperSubsetOfin interfaceSetIterable<T>
-
powerSet
- Specified by:
powerSetin interfaceMutableSet<T>- Specified by:
powerSetin interfaceUnsortedSetIterable<T>
-
cartesianProduct
- Specified by:
cartesianProductin interfaceSetIterable<T>
-
asParallel
- Specified by:
asParallelin interfaceSetIterable<T>- Specified by:
asParallelin interfaceUnsortedSetIterable<T>
-