Class CharHashSet
java.lang.Object
org.eclipse.collections.impl.primitive.AbstractCharIterable
org.eclipse.collections.impl.set.primitive.AbstractCharSet
org.eclipse.collections.impl.set.mutable.primitive.CharHashSet
- All Implemented Interfaces:
Externalizable
,Serializable
,CharIterable
,MutableCharCollection
,PrimitiveIterable
,CharSet
,MutableCharSet
This file was automatically generated from template file primitiveHashSet.stg.
- Since:
- 3.0.
- See Also:
-
Constructor Summary
ConstructorDescriptionCharHashSet
(char... elements) CharHashSet
(int initialCapacity) CharHashSet
(CharIterable elements) CharHashSet
(CharHashSet set) -
Method Summary
Modifier and TypeMethodDescriptionboolean
add
(char element) boolean
addAll
(char... source) boolean
addAll
(CharIterable source) boolean
allSatisfy
(CharPredicate predicate) Returns true if all of the elements in the CharIterable return true for the specified predicate, otherwise returns false.boolean
anySatisfy
(CharPredicate predicate) Returns true if any of the elements in the CharIterable return true for the specified predicate, otherwise returns false.void
appendString
(Appendable appendable, String start, String separator, String end) Prints a string representation of this collection onto the givenAppendable
.Returns a primitive iterator that can be used to iterate over the CharIterable in an imperative style.chunk
(int size) Partitions elements in fixed size chunks.void
clear()
<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.<V,
R extends Collection<V>>
Rcollect
(CharToObjectFunction<? extends V> function, R target) Same asCharIterable.collect(CharToObjectFunction)
, only the results are added to the target Collection.void
compact()
Rehashes every element in the set into a new backing table of the smallest possible size and eliminating removed sentinels.boolean
contains
(char value) Returns true if the value is contained in the CharIterable, and false if it is not.int
count
(CharPredicate predicate) Returns a count of the number of elements in the CharIterable that return true for the specified predicate.char
detectIfNone
(CharPredicate predicate, char ifNone) void
each
(CharProcedure procedure) A synonym for forEach.freeze()
Returns a frozen copy of this set.int
hashCode()
Follows the same general contract asSet.hashCode()
.<T> T
injectInto
(T injectedValue, ObjectCharToObjectFunction<? super T, ? extends T> function) char
max()
char
min()
newEmpty()
Creates a new empty CharHashSet.static CharHashSet
newSet
(CharIterable source) static CharHashSet
newSetWith
(char... source) void
reject
(CharPredicate predicate) Returns a new CharIterable with all of the elements in the CharIterable that return false for the specified predicate.<R extends MutableCharCollection>
Rreject
(CharPredicate predicate, R target) Same asCharIterable.reject(CharPredicate)
, only the results are added to the target MutableCharCollection.boolean
remove
(char value) boolean
removeAll
(char... source) boolean
removeAll
(CharIterable source) boolean
retainAll
(char... source) boolean
retainAll
(CharIterable source) select
(CharPredicate predicate) Returns a new CharIterable with all of the elements in the CharIterable that return true for the specified predicate.<R extends MutableCharCollection>
Rselect
(CharPredicate predicate, R target) Same asCharIterable.select(CharPredicate)
, only the results are added to the target MutableCharCollection.int
size()
Returns the number of items in this iterable.long
sum()
char[]
toArray()
Converts the CharIterable to a primitive char array.char[]
toArray
(char[] array) Converts the CharIterable to a primitive char array.Returns an immutable copy of this set.with
(char element) withAll
(CharIterable elements) without
(char element) withoutAll
(CharIterable elements) void
Methods inherited from class org.eclipse.collections.impl.set.primitive.AbstractCharSet
cartesianProduct, equals
Methods inherited from class org.eclipse.collections.impl.primitive.AbstractCharIterable
asLazy, average, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toString
Methods inherited from interface org.eclipse.collections.api.CharIterable
asLazy, average, averageIfEmpty, collectBoolean, collectByte, collectChar, collectDouble, collectFloat, collectInt, collectLong, collectShort, containsAll, containsAll, containsAny, containsAny, containsNone, containsNone, flatCollect, forEach, injectIntoBoolean, injectIntoByte, injectIntoChar, injectIntoDouble, injectIntoFloat, injectIntoInt, injectIntoLong, injectIntoShort, maxIfEmpty, median, medianIfEmpty, minIfEmpty, noneSatisfy, reduce, reduceIfEmpty, summaryStatistics, toBag, toList, toSet, toSortedArray, toSortedList, toSortedList, toSortedListBy, toSortedListBy
Methods inherited from interface org.eclipse.collections.api.set.primitive.CharSet
cartesianProduct, equals, isProperSubsetOf, isSubsetOf, tap
Methods inherited from interface org.eclipse.collections.api.collection.primitive.MutableCharCollection
removeIf
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, isEmpty, makeString, makeString, makeString, notEmpty, toString
-
Constructor Details
-
CharHashSet
public CharHashSet() -
CharHashSet
public CharHashSet(int initialCapacity) -
CharHashSet
public CharHashSet(char... elements) -
CharHashSet
-
CharHashSet
-
-
Method Details
-
newSet
-
newSetWith
-
hashCode
public int hashCode()Description copied from interface:CharSet
Follows the same general contract asSet.hashCode()
.- Specified by:
hashCode
in interfaceCharSet
- Specified by:
hashCode
in classAbstractCharSet
-
size
public int size()Description copied from interface:PrimitiveIterable
Returns the number of items in this iterable.- Specified by:
size
in interfacePrimitiveIterable
-
appendString
Description copied from interface:PrimitiveIterable
Prints a string representation of this collection onto the givenAppendable
. Prints the string returned byPrimitiveIterable.makeString(String, String, String)
.- Specified by:
appendString
in interfacePrimitiveIterable
-
add
public boolean add(char element) - Specified by:
add
in interfaceMutableCharCollection
-
addAll
public boolean addAll(char... source) - Specified by:
addAll
in interfaceMutableCharCollection
-
addAll
- Specified by:
addAll
in interfaceMutableCharCollection
-
remove
public boolean remove(char value) - Specified by:
remove
in interfaceMutableCharCollection
-
removeAll
- Specified by:
removeAll
in interfaceMutableCharCollection
-
removeAll
public boolean removeAll(char... source) - Specified by:
removeAll
in interfaceMutableCharCollection
-
retainAll
- Specified by:
retainAll
in interfaceMutableCharCollection
- See Also:
-
retainAll
public boolean retainAll(char... source) - Specified by:
retainAll
in interfaceMutableCharCollection
- See Also:
-
clear
public void clear()- Specified by:
clear
in interfaceMutableCharCollection
-
with
- Specified by:
with
in interfaceMutableCharCollection
- Specified by:
with
in interfaceMutableCharSet
-
without
- Specified by:
without
in interfaceMutableCharCollection
- Specified by:
without
in interfaceMutableCharSet
-
withAll
- Specified by:
withAll
in interfaceMutableCharCollection
- Specified by:
withAll
in interfaceMutableCharSet
-
withoutAll
- Specified by:
withoutAll
in interfaceMutableCharCollection
- Specified by:
withoutAll
in interfaceMutableCharSet
-
asUnmodifiable
- Specified by:
asUnmodifiable
in interfaceMutableCharCollection
- Specified by:
asUnmodifiable
in interfaceMutableCharSet
-
asSynchronized
- Specified by:
asSynchronized
in interfaceMutableCharCollection
- Specified by:
asSynchronized
in interfaceMutableCharSet
-
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
-
charIterator
Description copied from interface:CharIterable
Returns a primitive iterator that can be used to iterate over the CharIterable in an imperative style.- Specified by:
charIterator
in interfaceCharIterable
- Specified by:
charIterator
in interfaceMutableCharCollection
-
toArray
public char[] toArray()Description copied from interface:CharIterable
Converts the CharIterable to a primitive char array.- Specified by:
toArray
in interfaceCharIterable
-
toArray
public char[] toArray(char[] array) Description copied from interface:CharIterable
Converts the CharIterable to a primitive char array. If the collection fits into the provided array it is used to store its elements and is returned from the method, otherwise a new array of the appropriate size is allocated and returned. If the iterable is empty, the target array is returned unchanged.- Specified by:
toArray
in interfaceCharIterable
-
contains
public boolean contains(char value) Description copied from interface:CharIterable
Returns true if the value is contained in the CharIterable, and false if it is not.- Specified by:
contains
in interfaceCharIterable
-
each
Description copied from interface:CharIterable
A synonym for forEach.- Specified by:
each
in interfaceCharIterable
- Since:
- 7.0.
-
select
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
-
select
Description copied from interface:CharIterable
Same asCharIterable.select(CharPredicate)
, only the results are added to the target MutableCharCollection.- Specified by:
select
in interfaceCharIterable
- Since:
- 8.1.
-
reject
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
-
reject
Description copied from interface:CharIterable
Same asCharIterable.reject(CharPredicate)
, only the results are added to the target MutableCharCollection.- Specified by:
reject
in interfaceCharIterable
- Since:
- 8.1.
-
collect
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
-
collect
Description copied from interface:CharIterable
Same asCharIterable.collect(CharToObjectFunction)
, only the results are added to the target Collection.- Specified by:
collect
in interfaceCharIterable
- Since:
- 8.1.
-
detectIfNone
- Specified by:
detectIfNone
in interfaceCharIterable
-
count
Description copied from interface:CharIterable
Returns a count of the number of elements in the CharIterable that return true for the specified predicate.- Specified by:
count
in interfaceCharIterable
-
anySatisfy
Description copied from interface:CharIterable
Returns true if any of the elements in the CharIterable return true for the specified predicate, otherwise returns false.- Specified by:
anySatisfy
in interfaceCharIterable
-
allSatisfy
Description copied from interface:CharIterable
Returns true if all of the elements in the CharIterable return true for the specified predicate, otherwise returns false.- Specified by:
allSatisfy
in interfaceCharIterable
-
sum
public long sum()- Specified by:
sum
in interfaceCharIterable
-
max
public char max()- Specified by:
max
in interfaceCharIterable
-
min
public char min()- Specified by:
min
in interfaceCharIterable
-
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
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
-
injectInto
public <T> T injectInto(T injectedValue, ObjectCharToObjectFunction<? super T, ? extends T> function) - Specified by:
injectInto
in interfaceCharIterable
-
chunk
Description copied from interface:CharIterable
Partitions elements in fixed size chunks.- Specified by:
chunk
in interfaceCharIterable
- Parameters:
size
- the number of elements per chunk- Returns:
- A
RichIterable
containingCharIterable
s of sizesize
, except the last will be truncated if the elements don't divide evenly.
-
newEmpty
Creates a new empty CharHashSet.- Specified by:
newEmpty
in interfaceMutableCharCollection
- Specified by:
newEmpty
in interfaceMutableCharSet
- Since:
- 9.2.
-
compact
public void compact()Rehashes every element in the set into a new backing table of the smallest possible size and eliminating removed sentinels.
-