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