Class SynchronizedLongSet
- java.lang.Object
-
- org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedLongCollection
-
- org.eclipse.collections.impl.set.mutable.primitive.SynchronizedLongSet
-
- All Implemented Interfaces:
java.io.Serializable
,MutableLongCollection
,LongIterable
,PrimitiveIterable
,LongSet
,MutableLongSet
public class SynchronizedLongSet extends AbstractSynchronizedLongCollection implements MutableLongSet
A synchronized view of aMutableLongSet
. It is imperative that the user manually synchronize on the collection when iterating over it using theLongIterator
, as perCollections.synchronizedCollection(Collection)
.This file was automatically generated from template file synchronizedPrimitiveSet.stg.
- Since:
- 3.1.
- See Also:
MutableLongSet.asSynchronized()
,MutableSet.asSynchronized()
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description SynchronizedLongSet(MutableLongSet set)
SynchronizedLongSet(MutableLongSet set, java.lang.Object newLock)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LazyLongIterable
asLazy()
Returns a LazyLongIterable adapter wrapping the source LongIterable.MutableLongSet
asSynchronized()
MutableLongSet
asUnmodifiable()
LazyIterable<LongLongPair>
cartesianProduct(LongSet set)
Returns the set whose members are all possible ordered pairs (a, b) where a is a member ofthis
and b is a member ofset
.<V> MutableSet<V>
collect(LongToObjectFunction<? extends V> function)
Returns a new collection with the results of applying the specified function on each element of the source collection.boolean
equals(java.lang.Object otherSet)
Follows the same general contract asSet.equals(Object)
.LongSet
freeze()
Returns a frozen copy of this set.private MutableLongSet
getMutableLongSet()
int
hashCode()
Follows the same general contract asSet.hashCode()
.MutableLongSet
newEmpty()
Creates a new empty mutable version of the same Set type.static SynchronizedLongSet
of(MutableLongSet set)
This method will take a MutableLongSet and wrap it directly in a SynchronizedLongSet.static SynchronizedLongSet
of(MutableLongSet set, java.lang.Object lock)
This method will take a MutableLongSet and wrap it directly in a SynchronizedLongSet.MutableLongSet
reject(LongPredicate predicate)
Returns a new LongIterable with all of the elements in the LongIterable that return false for the specified predicate.MutableLongSet
select(LongPredicate predicate)
Returns a new LongIterable with all of the elements in the LongIterable that return true for the specified predicate.ImmutableLongSet
toImmutable()
Returns an immutable copy of this set.SynchronizedLongSet
with(long element)
SynchronizedLongSet
withAll(LongIterable elements)
SynchronizedLongSet
without(long element)
SynchronizedLongSet
withoutAll(LongIterable elements)
-
Methods inherited from class org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedLongCollection
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, average, chunk, clear, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, each, getLock, getLongCollection, injectInto, isEmpty, longIterator, 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.LongIterable
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.LongSet
isProperSubsetOf, isSubsetOf
-
Methods inherited from interface org.eclipse.collections.api.collection.primitive.MutableLongCollection
add, addAll, addAll, clear, longIterator, remove, removeAll, removeAll, removeIf, retainAll, retainAll
-
Methods inherited from interface org.eclipse.collections.api.set.primitive.MutableLongSet
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
-
SynchronizedLongSet
public SynchronizedLongSet(MutableLongSet set)
-
SynchronizedLongSet
public SynchronizedLongSet(MutableLongSet set, java.lang.Object newLock)
-
-
Method Detail
-
of
public static SynchronizedLongSet of(MutableLongSet set)
This method will take a MutableLongSet and wrap it directly in a SynchronizedLongSet.
-
of
public static SynchronizedLongSet of(MutableLongSet set, java.lang.Object lock)
This method will take a MutableLongSet and wrap it directly in a SynchronizedLongSet. Additionally, a developer specifies which lock to use with the collection.
-
getMutableLongSet
private MutableLongSet getMutableLongSet()
-
without
public SynchronizedLongSet without(long element)
- Specified by:
without
in interfaceMutableLongCollection
- Specified by:
without
in interfaceMutableLongSet
- Overrides:
without
in classAbstractSynchronizedLongCollection
-
with
public SynchronizedLongSet with(long element)
- Specified by:
with
in interfaceMutableLongCollection
- Specified by:
with
in interfaceMutableLongSet
- Overrides:
with
in classAbstractSynchronizedLongCollection
-
withAll
public SynchronizedLongSet withAll(LongIterable elements)
- Specified by:
withAll
in interfaceMutableLongCollection
- Specified by:
withAll
in interfaceMutableLongSet
- Overrides:
withAll
in classAbstractSynchronizedLongCollection
-
withoutAll
public SynchronizedLongSet withoutAll(LongIterable elements)
- Specified by:
withoutAll
in interfaceMutableLongCollection
- Specified by:
withoutAll
in interfaceMutableLongSet
- Overrides:
withoutAll
in classAbstractSynchronizedLongCollection
-
select
public MutableLongSet select(LongPredicate predicate)
Description copied from interface:LongIterable
Returns a new LongIterable with all of the elements in the LongIterable that return true for the specified predicate.- Specified by:
select
in interfaceLongIterable
- Specified by:
select
in interfaceLongSet
- Specified by:
select
in interfaceMutableLongCollection
- Specified by:
select
in interfaceMutableLongSet
- Overrides:
select
in classAbstractSynchronizedLongCollection
-
reject
public MutableLongSet reject(LongPredicate predicate)
Description copied from interface:LongIterable
Returns a new LongIterable with all of the elements in the LongIterable that return false for the specified predicate.- Specified by:
reject
in interfaceLongIterable
- Specified by:
reject
in interfaceLongSet
- Specified by:
reject
in interfaceMutableLongCollection
- Specified by:
reject
in interfaceMutableLongSet
- Overrides:
reject
in classAbstractSynchronizedLongCollection
-
collect
public <V> MutableSet<V> collect(LongToObjectFunction<? extends V> function)
Description copied from interface:LongIterable
Returns 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:
collect
in interfaceLongIterable
- Specified by:
collect
in interfaceLongSet
- Specified by:
collect
in interfaceMutableLongCollection
- Specified by:
collect
in interfaceMutableLongSet
- Overrides:
collect
in classAbstractSynchronizedLongCollection
-
cartesianProduct
public LazyIterable<LongLongPair> cartesianProduct(LongSet set)
Description copied from interface:LongSet
Returns the set whose members are all possible ordered pairs (a, b) where a is a member ofthis
and b is a member ofset
.- Specified by:
cartesianProduct
in interfaceLongSet
-
equals
public boolean equals(java.lang.Object otherSet)
Description copied from interface:LongSet
Follows the same general contract asSet.equals(Object)
.
-
hashCode
public int hashCode()
Description copied from interface:LongSet
Follows the same general contract asSet.hashCode()
.
-
asLazy
public LazyLongIterable asLazy()
Description copied from interface:LongIterable
Returns a LazyLongIterable adapter wrapping the source LongIterable.- Specified by:
asLazy
in interfaceLongIterable
- Overrides:
asLazy
in classAbstractSynchronizedLongCollection
-
asUnmodifiable
public MutableLongSet asUnmodifiable()
- Specified by:
asUnmodifiable
in interfaceMutableLongCollection
- Specified by:
asUnmodifiable
in interfaceMutableLongSet
- Overrides:
asUnmodifiable
in classAbstractSynchronizedLongCollection
-
asSynchronized
public MutableLongSet asSynchronized()
- Specified by:
asSynchronized
in interfaceMutableLongCollection
- Specified by:
asSynchronized
in interfaceMutableLongSet
- Overrides:
asSynchronized
in classAbstractSynchronizedLongCollection
-
freeze
public LongSet freeze()
Description copied from interface:MutableLongSet
Returns a frozen copy of this set. A frozen copy is the same thing as an immutable copy without safe-publish guarantees.- Specified by:
freeze
in interfaceLongSet
- Specified by:
freeze
in interfaceMutableLongSet
-
toImmutable
public ImmutableLongSet toImmutable()
Description copied from interface:MutableLongSet
Returns an immutable copy of this set.- Specified by:
toImmutable
in interfaceLongSet
- Specified by:
toImmutable
in interfaceMutableLongCollection
- Specified by:
toImmutable
in interfaceMutableLongSet
- Overrides:
toImmutable
in classAbstractSynchronizedLongCollection
-
newEmpty
public MutableLongSet newEmpty()
Description copied from interface:MutableLongSet
Creates a new empty mutable version of the same Set type.- Specified by:
newEmpty
in interfaceMutableLongCollection
- Specified by:
newEmpty
in interfaceMutableLongSet
- Since:
- 9.2.
-
-