Class SynchronizedIntSet
- java.lang.Object
-
- org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedIntCollection
-
- org.eclipse.collections.impl.set.mutable.primitive.SynchronizedIntSet
-
- All Implemented Interfaces:
java.io.Serializable,MutableIntCollection,IntIterable,PrimitiveIterable,IntSet,MutableIntSet
public class SynchronizedIntSet extends AbstractSynchronizedIntCollection implements MutableIntSet
A synchronized view of aMutableIntSet. It is imperative that the user manually synchronize on the collection when iterating over it using theIntIterator, as perCollections.synchronizedCollection(Collection).This file was automatically generated from template file synchronizedPrimitiveSet.stg.
- Since:
- 3.1.
- See Also:
MutableIntSet.asSynchronized(),MutableSet.asSynchronized(), Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description SynchronizedIntSet(MutableIntSet set)SynchronizedIntSet(MutableIntSet set, java.lang.Object newLock)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LazyIntIterableasLazy()Returns a LazyIntIterable adapter wrapping the source IntIterable.MutableIntSetasSynchronized()MutableIntSetasUnmodifiable()MutableSet<java.lang.Integer>boxed()LazyIterable<IntIntPair>cartesianProduct(IntSet set)Returns the set whose members are all possible ordered pairs (a, b) where a is a member ofthisand b is a member ofset.<V> MutableSet<V>collect(IntToObjectFunction<? extends V> function)Returns a new collection with the results of applying the specified function on each element of the source collection.booleanequals(java.lang.Object otherSet)Follows the same general contract asSet.equals(Object).IntSetfreeze()Returns a frozen copy of this set.private MutableIntSetgetMutableIntSet()inthashCode()Follows the same general contract asSet.hashCode().MutableIntSetnewEmpty()Creates a new empty mutable version of the same Set type.static SynchronizedIntSetof(MutableIntSet set)This method will take a MutableIntSet and wrap it directly in a SynchronizedIntSet.static SynchronizedIntSetof(MutableIntSet set, java.lang.Object lock)This method will take a MutableIntSet and wrap it directly in a SynchronizedIntSet.MutableIntSetreject(IntPredicate predicate)Returns a new IntIterable with all of the elements in the IntIterable that return false for the specified predicate.MutableIntSetselect(IntPredicate predicate)Returns a new IntIterable with all of the elements in the IntIterable that return true for the specified predicate.ImmutableIntSettoImmutable()Returns an immutable copy of this set.SynchronizedIntSetwith(int element)SynchronizedIntSetwithAll(IntIterable elements)SynchronizedIntSetwithout(int element)SynchronizedIntSetwithoutAll(IntIterable elements)-
Methods inherited from class org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedIntCollection
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, average, chunk, clear, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, getIntCollection, getLock, injectInto, intIterator, isEmpty, makeString, makeString, makeString, max, maxIfEmpty, median, min, minIfEmpty, noneSatisfy, notEmpty, reduce, reduceIfEmpty, remove, removeAll, removeAll, removeIf, retainAll, retainAll, size, sum, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.collections.api.IntIterable
allSatisfy, anySatisfy, average, averageIfEmpty, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, flatCollect, forEach, injectInto, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, max, maxIfEmpty, median, medianIfEmpty, min, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, reject, select, sum, summaryStatistics, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListBy
-
Methods inherited from interface org.eclipse.collections.api.set.primitive.IntSet
isProperSubsetOf, isSubsetOf
-
Methods inherited from interface org.eclipse.collections.api.collection.primitive.MutableIntCollection
add, addAll, addAll, clear, intIterator, remove, removeAll, removeAll, removeIf, retainAll, retainAll
-
Methods inherited from interface org.eclipse.collections.api.set.primitive.MutableIntSet
difference, intersect, symmetricDifference, tap, union
-
Methods inherited from interface org.eclipse.collections.api.PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SynchronizedIntSet
public SynchronizedIntSet(MutableIntSet set)
-
SynchronizedIntSet
public SynchronizedIntSet(MutableIntSet set, java.lang.Object newLock)
-
-
Method Detail
-
of
public static SynchronizedIntSet of(MutableIntSet set)
This method will take a MutableIntSet and wrap it directly in a SynchronizedIntSet.
-
of
public static SynchronizedIntSet of(MutableIntSet set, java.lang.Object lock)
This method will take a MutableIntSet and wrap it directly in a SynchronizedIntSet. Additionally, a developer specifies which lock to use with the collection.
-
getMutableIntSet
private MutableIntSet getMutableIntSet()
-
without
public SynchronizedIntSet without(int element)
- Specified by:
withoutin interfaceMutableIntCollection- Specified by:
withoutin interfaceMutableIntSet- Overrides:
withoutin classAbstractSynchronizedIntCollection
-
boxed
public MutableSet<java.lang.Integer> boxed()
- Specified by:
boxedin interfaceMutableIntSet
-
with
public SynchronizedIntSet with(int element)
- Specified by:
within interfaceMutableIntCollection- Specified by:
within interfaceMutableIntSet- Overrides:
within classAbstractSynchronizedIntCollection
-
withAll
public SynchronizedIntSet withAll(IntIterable elements)
- Specified by:
withAllin interfaceMutableIntCollection- Specified by:
withAllin interfaceMutableIntSet- Overrides:
withAllin classAbstractSynchronizedIntCollection
-
withoutAll
public SynchronizedIntSet withoutAll(IntIterable elements)
- Specified by:
withoutAllin interfaceMutableIntCollection- Specified by:
withoutAllin interfaceMutableIntSet- Overrides:
withoutAllin classAbstractSynchronizedIntCollection
-
select
public MutableIntSet select(IntPredicate predicate)
Description copied from interface:IntIterableReturns a new IntIterable with all of the elements in the IntIterable that return true for the specified predicate.- Specified by:
selectin interfaceIntIterable- Specified by:
selectin interfaceIntSet- Specified by:
selectin interfaceMutableIntCollection- Specified by:
selectin interfaceMutableIntSet- Overrides:
selectin classAbstractSynchronizedIntCollection
-
reject
public MutableIntSet reject(IntPredicate predicate)
Description copied from interface:IntIterableReturns a new IntIterable with all of the elements in the IntIterable that return false for the specified predicate.- Specified by:
rejectin interfaceIntIterable- Specified by:
rejectin interfaceIntSet- Specified by:
rejectin interfaceMutableIntCollection- Specified by:
rejectin interfaceMutableIntSet- Overrides:
rejectin classAbstractSynchronizedIntCollection
-
collect
public <V> MutableSet<V> collect(IntToObjectFunction<? extends V> function)
Description copied from interface:IntIterableReturns 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.- Specified by:
collectin interfaceIntIterable- Specified by:
collectin interfaceIntSet- Specified by:
collectin interfaceMutableIntCollection- Specified by:
collectin interfaceMutableIntSet- Overrides:
collectin classAbstractSynchronizedIntCollection
-
cartesianProduct
public LazyIterable<IntIntPair> cartesianProduct(IntSet set)
Description copied from interface:IntSetReturns 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 interfaceIntSet
-
equals
public boolean equals(java.lang.Object otherSet)
Description copied from interface:IntSetFollows the same general contract asSet.equals(Object).
-
hashCode
public int hashCode()
Description copied from interface:IntSetFollows the same general contract asSet.hashCode().
-
asLazy
public LazyIntIterable asLazy()
Description copied from interface:IntIterableReturns a LazyIntIterable adapter wrapping the source IntIterable.- Specified by:
asLazyin interfaceIntIterable- Overrides:
asLazyin classAbstractSynchronizedIntCollection
-
asUnmodifiable
public MutableIntSet asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableIntCollection- Specified by:
asUnmodifiablein interfaceMutableIntSet- Overrides:
asUnmodifiablein classAbstractSynchronizedIntCollection
-
asSynchronized
public MutableIntSet asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableIntCollection- Specified by:
asSynchronizedin interfaceMutableIntSet- Overrides:
asSynchronizedin classAbstractSynchronizedIntCollection
-
freeze
public IntSet freeze()
Description copied from interface:MutableIntSetReturns a frozen copy of this set. A frozen copy is the same thing as an immutable copy without safe-publish guarantees.- Specified by:
freezein interfaceIntSet- Specified by:
freezein interfaceMutableIntSet
-
toImmutable
public ImmutableIntSet toImmutable()
Description copied from interface:MutableIntSetReturns an immutable copy of this set.- Specified by:
toImmutablein interfaceIntSet- Specified by:
toImmutablein interfaceMutableIntCollection- Specified by:
toImmutablein interfaceMutableIntSet- Overrides:
toImmutablein classAbstractSynchronizedIntCollection
-
newEmpty
public MutableIntSet newEmpty()
Description copied from interface:MutableIntSetCreates a new empty mutable version of the same Set type.- Specified by:
newEmptyin interfaceMutableIntCollection- Specified by:
newEmptyin interfaceMutableIntSet- Since:
- 9.2.
-
-