Class SynchronizedDoubleSet
- java.lang.Object
-
- org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedDoubleCollection
-
- org.eclipse.collections.impl.set.mutable.primitive.SynchronizedDoubleSet
-
- All Implemented Interfaces:
java.io.Serializable
,MutableDoubleCollection
,DoubleIterable
,PrimitiveIterable
,DoubleSet
,MutableDoubleSet
public class SynchronizedDoubleSet extends AbstractSynchronizedDoubleCollection implements MutableDoubleSet
A synchronized view of aMutableDoubleSet
. It is imperative that the user manually synchronize on the collection when iterating over it using theDoubleIterator
, as perCollections.synchronizedCollection(Collection)
.This file was automatically generated from template file synchronizedPrimitiveSet.stg.
- Since:
- 3.1.
- See Also:
MutableDoubleSet.asSynchronized()
,MutableSet.asSynchronized()
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static long
serialVersionUID
-
Constructor Summary
Constructors Constructor Description SynchronizedDoubleSet(MutableDoubleSet set)
SynchronizedDoubleSet(MutableDoubleSet set, java.lang.Object newLock)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LazyDoubleIterable
asLazy()
Returns a LazyDoubleIterable adapter wrapping the source DoubleIterable.MutableDoubleSet
asSynchronized()
MutableDoubleSet
asUnmodifiable()
LazyIterable<DoubleDoublePair>
cartesianProduct(DoubleSet 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(DoubleToObjectFunction<? 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)
.DoubleSet
freeze()
Returns a frozen copy of this set.private MutableDoubleSet
getMutableDoubleSet()
int
hashCode()
Follows the same general contract asSet.hashCode()
.MutableDoubleSet
newEmpty()
Creates a new empty mutable version of the same Set type.static SynchronizedDoubleSet
of(MutableDoubleSet set)
This method will take a MutableDoubleSet and wrap it directly in a SynchronizedDoubleSet.static SynchronizedDoubleSet
of(MutableDoubleSet set, java.lang.Object lock)
This method will take a MutableDoubleSet and wrap it directly in a SynchronizedDoubleSet.MutableDoubleSet
reject(DoublePredicate predicate)
Returns a new DoubleIterable with all of the elements in the DoubleIterable that return false for the specified predicate.MutableDoubleSet
select(DoublePredicate predicate)
Returns a new DoubleIterable with all of the elements in the DoubleIterable that return true for the specified predicate.ImmutableDoubleSet
toImmutable()
Returns an immutable copy of this set.SynchronizedDoubleSet
with(double element)
SynchronizedDoubleSet
withAll(DoubleIterable elements)
SynchronizedDoubleSet
without(double element)
SynchronizedDoubleSet
withoutAll(DoubleIterable elements)
-
Methods inherited from class org.eclipse.collections.impl.collection.mutable.primitive.AbstractSynchronizedDoubleCollection
add, addAll, addAll, allSatisfy, anySatisfy, appendString, appendString, appendString, average, chunk, clear, contains, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, count, detectIfNone, doubleIterator, each, getDoubleCollection, getLock, injectInto, 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.DoubleIterable
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.DoubleSet
isProperSubsetOf, isSubsetOf
-
Methods inherited from interface org.eclipse.collections.api.collection.primitive.MutableDoubleCollection
add, addAll, addAll, clear, doubleIterator, remove, removeAll, removeAll, removeIf, retainAll, retainAll
-
Methods inherited from interface org.eclipse.collections.api.set.primitive.MutableDoubleSet
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
-
SynchronizedDoubleSet
public SynchronizedDoubleSet(MutableDoubleSet set)
-
SynchronizedDoubleSet
public SynchronizedDoubleSet(MutableDoubleSet set, java.lang.Object newLock)
-
-
Method Detail
-
of
public static SynchronizedDoubleSet of(MutableDoubleSet set)
This method will take a MutableDoubleSet and wrap it directly in a SynchronizedDoubleSet.
-
of
public static SynchronizedDoubleSet of(MutableDoubleSet set, java.lang.Object lock)
This method will take a MutableDoubleSet and wrap it directly in a SynchronizedDoubleSet. Additionally, a developer specifies which lock to use with the collection.
-
getMutableDoubleSet
private MutableDoubleSet getMutableDoubleSet()
-
without
public SynchronizedDoubleSet without(double element)
- Specified by:
without
in interfaceMutableDoubleCollection
- Specified by:
without
in interfaceMutableDoubleSet
- Overrides:
without
in classAbstractSynchronizedDoubleCollection
-
with
public SynchronizedDoubleSet with(double element)
- Specified by:
with
in interfaceMutableDoubleCollection
- Specified by:
with
in interfaceMutableDoubleSet
- Overrides:
with
in classAbstractSynchronizedDoubleCollection
-
withAll
public SynchronizedDoubleSet withAll(DoubleIterable elements)
- Specified by:
withAll
in interfaceMutableDoubleCollection
- Specified by:
withAll
in interfaceMutableDoubleSet
- Overrides:
withAll
in classAbstractSynchronizedDoubleCollection
-
withoutAll
public SynchronizedDoubleSet withoutAll(DoubleIterable elements)
- Specified by:
withoutAll
in interfaceMutableDoubleCollection
- Specified by:
withoutAll
in interfaceMutableDoubleSet
- Overrides:
withoutAll
in classAbstractSynchronizedDoubleCollection
-
select
public MutableDoubleSet select(DoublePredicate predicate)
Description copied from interface:DoubleIterable
Returns a new DoubleIterable with all of the elements in the DoubleIterable that return true for the specified predicate.- Specified by:
select
in interfaceDoubleIterable
- Specified by:
select
in interfaceDoubleSet
- Specified by:
select
in interfaceMutableDoubleCollection
- Specified by:
select
in interfaceMutableDoubleSet
- Overrides:
select
in classAbstractSynchronizedDoubleCollection
-
reject
public MutableDoubleSet reject(DoublePredicate predicate)
Description copied from interface:DoubleIterable
Returns a new DoubleIterable with all of the elements in the DoubleIterable that return false for the specified predicate.- Specified by:
reject
in interfaceDoubleIterable
- Specified by:
reject
in interfaceDoubleSet
- Specified by:
reject
in interfaceMutableDoubleCollection
- Specified by:
reject
in interfaceMutableDoubleSet
- Overrides:
reject
in classAbstractSynchronizedDoubleCollection
-
collect
public <V> MutableSet<V> collect(DoubleToObjectFunction<? extends V> function)
Description copied from interface:DoubleIterable
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 interfaceDoubleIterable
- Specified by:
collect
in interfaceDoubleSet
- Specified by:
collect
in interfaceMutableDoubleCollection
- Specified by:
collect
in interfaceMutableDoubleSet
- Overrides:
collect
in classAbstractSynchronizedDoubleCollection
-
cartesianProduct
public LazyIterable<DoubleDoublePair> cartesianProduct(DoubleSet set)
Description copied from interface:DoubleSet
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 interfaceDoubleSet
-
equals
public boolean equals(java.lang.Object otherSet)
Description copied from interface:DoubleSet
Follows the same general contract asSet.equals(Object)
.
-
hashCode
public int hashCode()
Description copied from interface:DoubleSet
Follows the same general contract asSet.hashCode()
.
-
asLazy
public LazyDoubleIterable asLazy()
Description copied from interface:DoubleIterable
Returns a LazyDoubleIterable adapter wrapping the source DoubleIterable.- Specified by:
asLazy
in interfaceDoubleIterable
- Overrides:
asLazy
in classAbstractSynchronizedDoubleCollection
-
asUnmodifiable
public MutableDoubleSet asUnmodifiable()
- Specified by:
asUnmodifiable
in interfaceMutableDoubleCollection
- Specified by:
asUnmodifiable
in interfaceMutableDoubleSet
- Overrides:
asUnmodifiable
in classAbstractSynchronizedDoubleCollection
-
asSynchronized
public MutableDoubleSet asSynchronized()
- Specified by:
asSynchronized
in interfaceMutableDoubleCollection
- Specified by:
asSynchronized
in interfaceMutableDoubleSet
- Overrides:
asSynchronized
in classAbstractSynchronizedDoubleCollection
-
freeze
public DoubleSet freeze()
Description copied from interface:MutableDoubleSet
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 interfaceDoubleSet
- Specified by:
freeze
in interfaceMutableDoubleSet
-
toImmutable
public ImmutableDoubleSet toImmutable()
Description copied from interface:MutableDoubleSet
Returns an immutable copy of this set.- Specified by:
toImmutable
in interfaceDoubleSet
- Specified by:
toImmutable
in interfaceMutableDoubleCollection
- Specified by:
toImmutable
in interfaceMutableDoubleSet
- Overrides:
toImmutable
in classAbstractSynchronizedDoubleCollection
-
newEmpty
public MutableDoubleSet newEmpty()
Description copied from interface:MutableDoubleSet
Creates a new empty mutable version of the same Set type.- Specified by:
newEmpty
in interfaceMutableDoubleCollection
- Specified by:
newEmpty
in interfaceMutableDoubleSet
- Since:
- 9.2.
-
-