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 longserialVersionUID
-
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 LazyLongIterableasLazy()Returns a LazyLongIterable adapter wrapping the source LongIterable.MutableLongSetasSynchronized()MutableLongSetasUnmodifiable()MutableSet<java.lang.Long>boxed()LazyIterable<LongLongPair>cartesianProduct(LongSet 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(LongToObjectFunction<? 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).LongSetfreeze()Returns a frozen copy of this set.private MutableLongSetgetMutableLongSet()inthashCode()Follows the same general contract asSet.hashCode().MutableLongSetnewEmpty()Creates a new empty mutable version of the same Set type.static SynchronizedLongSetof(MutableLongSet set)This method will take a MutableLongSet and wrap it directly in a SynchronizedLongSet.static SynchronizedLongSetof(MutableLongSet set, java.lang.Object lock)This method will take a MutableLongSet and wrap it directly in a SynchronizedLongSet.MutableLongSetreject(LongPredicate predicate)Returns a new LongIterable with all of the elements in the LongIterable that return false for the specified predicate.MutableLongSetselect(LongPredicate predicate)Returns a new LongIterable with all of the elements in the LongIterable that return true for the specified predicate.ImmutableLongSettoImmutable()Returns an immutable copy of this set.SynchronizedLongSetwith(long element)SynchronizedLongSetwithAll(LongIterable elements)SynchronizedLongSetwithout(long element)SynchronizedLongSetwithoutAll(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:
withoutin interfaceMutableLongCollection- Specified by:
withoutin interfaceMutableLongSet- Overrides:
withoutin classAbstractSynchronizedLongCollection
-
boxed
public MutableSet<java.lang.Long> boxed()
- Specified by:
boxedin interfaceMutableLongSet
-
with
public SynchronizedLongSet with(long element)
- Specified by:
within interfaceMutableLongCollection- Specified by:
within interfaceMutableLongSet- Overrides:
within classAbstractSynchronizedLongCollection
-
withAll
public SynchronizedLongSet withAll(LongIterable elements)
- Specified by:
withAllin interfaceMutableLongCollection- Specified by:
withAllin interfaceMutableLongSet- Overrides:
withAllin classAbstractSynchronizedLongCollection
-
withoutAll
public SynchronizedLongSet withoutAll(LongIterable elements)
- Specified by:
withoutAllin interfaceMutableLongCollection- Specified by:
withoutAllin interfaceMutableLongSet- Overrides:
withoutAllin classAbstractSynchronizedLongCollection
-
select
public MutableLongSet select(LongPredicate predicate)
Description copied from interface:LongIterableReturns a new LongIterable with all of the elements in the LongIterable that return true for the specified predicate.- Specified by:
selectin interfaceLongIterable- Specified by:
selectin interfaceLongSet- Specified by:
selectin interfaceMutableLongCollection- Specified by:
selectin interfaceMutableLongSet- Overrides:
selectin classAbstractSynchronizedLongCollection
-
reject
public MutableLongSet reject(LongPredicate predicate)
Description copied from interface:LongIterableReturns a new LongIterable with all of the elements in the LongIterable that return false for the specified predicate.- Specified by:
rejectin interfaceLongIterable- Specified by:
rejectin interfaceLongSet- Specified by:
rejectin interfaceMutableLongCollection- Specified by:
rejectin interfaceMutableLongSet- Overrides:
rejectin classAbstractSynchronizedLongCollection
-
collect
public <V> MutableSet<V> collect(LongToObjectFunction<? extends V> function)
Description copied from interface:LongIterableReturns 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 interfaceLongIterable- Specified by:
collectin interfaceLongSet- Specified by:
collectin interfaceMutableLongCollection- Specified by:
collectin interfaceMutableLongSet- Overrides:
collectin classAbstractSynchronizedLongCollection
-
cartesianProduct
public LazyIterable<LongLongPair> cartesianProduct(LongSet set)
Description copied from interface:LongSetReturns 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 interfaceLongSet
-
equals
public boolean equals(java.lang.Object otherSet)
Description copied from interface:LongSetFollows the same general contract asSet.equals(Object).
-
hashCode
public int hashCode()
Description copied from interface:LongSetFollows the same general contract asSet.hashCode().
-
asLazy
public LazyLongIterable asLazy()
Description copied from interface:LongIterableReturns a LazyLongIterable adapter wrapping the source LongIterable.- Specified by:
asLazyin interfaceLongIterable- Overrides:
asLazyin classAbstractSynchronizedLongCollection
-
asUnmodifiable
public MutableLongSet asUnmodifiable()
- Specified by:
asUnmodifiablein interfaceMutableLongCollection- Specified by:
asUnmodifiablein interfaceMutableLongSet- Overrides:
asUnmodifiablein classAbstractSynchronizedLongCollection
-
asSynchronized
public MutableLongSet asSynchronized()
- Specified by:
asSynchronizedin interfaceMutableLongCollection- Specified by:
asSynchronizedin interfaceMutableLongSet- Overrides:
asSynchronizedin classAbstractSynchronizedLongCollection
-
freeze
public LongSet freeze()
Description copied from interface:MutableLongSetReturns a frozen copy of this set. A frozen copy is the same thing as an immutable copy without safe-publish guarantees.- Specified by:
freezein interfaceLongSet- Specified by:
freezein interfaceMutableLongSet
-
toImmutable
public ImmutableLongSet toImmutable()
Description copied from interface:MutableLongSetReturns an immutable copy of this set.- Specified by:
toImmutablein interfaceLongSet- Specified by:
toImmutablein interfaceMutableLongCollection- Specified by:
toImmutablein interfaceMutableLongSet- Overrides:
toImmutablein classAbstractSynchronizedLongCollection
-
newEmpty
public MutableLongSet newEmpty()
Description copied from interface:MutableLongSetCreates a new empty mutable version of the same Set type.- Specified by:
newEmptyin interfaceMutableLongCollection- Specified by:
newEmptyin interfaceMutableLongSet- Since:
- 9.2.
-
-