Class SynchronizedLongSet
java.lang.Object
org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedLongCollection
org.eclipse.collections.impl.set.mutable.primitive.SynchronizedLongSet
- All Implemented Interfaces:
Serializable
,MutableLongCollection
,LongIterable
,PrimitiveIterable
,LongSet
,MutableLongSet
public class SynchronizedLongSet extends AbstractSynchronizedLongCollection implements MutableLongSet
A synchronized view of a
MutableLongSet
. It is imperative that the user manually synchronize on the collection when iterating over it using the
LongIterator
, as per Collections.synchronizedCollection(Collection)
.
This file was automatically generated from template file synchronizedPrimitiveSet.stg.
- Since:
- 3.1.
- See Also:
MutableLongSet.asSynchronized()
,MutableSet.asSynchronized()
, Serialized Form
-
Constructor Summary
Constructors Constructor Description SynchronizedLongSet(MutableLongSet set)
SynchronizedLongSet(MutableLongSet set, Object newLock)
-
Method Summary
Modifier and Type Method Description LazyLongIterable
asLazy()
Returns a LazyLongIterable adapter wrapping the source LongIterable.MutableLongSet
asSynchronized()
MutableLongSet
asUnmodifiable()
<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(Object otherSet)
Follows the same general contract asSet.equals(Object)
.LongSet
freeze()
Returns a frozen copy of this set.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, 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, count, detectIfNone, each, forEach, 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 interface org.eclipse.collections.api.LongIterable
allSatisfy, anySatisfy, average, averageIfEmpty, chunk, collect, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, contains, containsAll, containsAll, count, detectIfNone, each, flatCollect, forEach, injectInto, max, maxIfEmpty, median, medianIfEmpty, min, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, reject, select, sum, summaryStatistics, toArray, toArray, toBag, toList, toSet, toSortedArray, toSortedList
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.PrimitiveIterable
appendString, appendString, appendString, isEmpty, makeString, makeString, makeString, notEmpty, size, toString
-
Constructor Details
-
Method Details
-
of
This method will take a MutableLongSet and wrap it directly in a SynchronizedLongSet. -
of
This method will take a MutableLongSet and wrap it directly in a SynchronizedLongSet. Additionally, a developer specifies which lock to use with the collection. -
without
- Specified by:
without
in interfaceMutableLongCollection
- Specified by:
without
in interfaceMutableLongSet
- Overrides:
without
in classAbstractSynchronizedLongCollection
-
with
- Specified by:
with
in interfaceMutableLongCollection
- Specified by:
with
in interfaceMutableLongSet
- Overrides:
with
in classAbstractSynchronizedLongCollection
-
withAll
- Specified by:
withAll
in interfaceMutableLongCollection
- Specified by:
withAll
in interfaceMutableLongSet
- Overrides:
withAll
in classAbstractSynchronizedLongCollection
-
withoutAll
- Specified by:
withoutAll
in interfaceMutableLongCollection
- Specified by:
withoutAll
in interfaceMutableLongSet
- Overrides:
withoutAll
in classAbstractSynchronizedLongCollection
-
select
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
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
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
-
equals
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
Description copied from interface:LongIterable
Returns a LazyLongIterable adapter wrapping the source LongIterable.- Specified by:
asLazy
in interfaceLongIterable
- Overrides:
asLazy
in classAbstractSynchronizedLongCollection
-
asUnmodifiable
- Specified by:
asUnmodifiable
in interfaceMutableLongCollection
- Specified by:
asUnmodifiable
in interfaceMutableLongSet
- Overrides:
asUnmodifiable
in classAbstractSynchronizedLongCollection
-
asSynchronized
- Specified by:
asSynchronized
in interfaceMutableLongCollection
- Specified by:
asSynchronized
in interfaceMutableLongSet
- Overrides:
asSynchronized
in classAbstractSynchronizedLongCollection
-
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
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
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.
-