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
ConstructorsConstructorDescriptionCharHashSet(char... elements) CharHashSet(int initialCapacity) CharHashSet(CharIterable elements) CharHashSet(CharHashSet set) -
Method Summary
Modifier and TypeMethodDescriptionbooleanadd(char element) booleanaddAll(char... source) booleanaddAll(CharIterable source) booleanallSatisfy(CharPredicate predicate) Returns true if all of the elements in the CharIterable return true for the specified predicate, otherwise returns false.booleananySatisfy(CharPredicate predicate) Returns true if any of the elements in the CharIterable return true for the specified predicate, otherwise returns false.voidappendString(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.voidclear()<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.voidcompact()Rehashes every element in the set into a new backing table of the smallest possible size and eliminating removed sentinels.booleancontains(char value) Returns true if the value is contained in the CharIterable, and false if it is not.intcount(CharPredicate predicate) Returns a count of the number of elements in the CharIterable that return true for the specified predicate.chardetectIfNone(CharPredicate predicate, char ifNone) voideach(CharProcedure procedure) A synonym for forEach.freeze()Returns a frozen copy of this set.inthashCode()Follows the same general contract asSet.hashCode().<T> TinjectInto(T injectedValue, ObjectCharToObjectFunction<? super T, ? extends T> function) charmax()charmin()newEmpty()Creates a new empty CharHashSet.static CharHashSetnewSet(CharIterable source) static CharHashSetnewSetWith(char... source) voidreject(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.booleanremove(char value) booleanremoveAll(char... source) booleanremoveAll(CharIterable source) booleanretainAll(char... source) booleanretainAll(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.intsize()Returns the number of items in this iterable.longsum()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) voidMethods inherited from class org.eclipse.collections.impl.set.primitive.AbstractCharSet
cartesianProduct, equalsMethods inherited from class org.eclipse.collections.impl.primitive.AbstractCharIterable
asLazy, average, maxIfEmpty, median, minIfEmpty, toBag, toList, toSet, toSortedArray, toSortedList, toStringMethods 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, toSortedListByMethods inherited from interface org.eclipse.collections.api.set.primitive.CharSet
cartesianProduct, equals, isProperSubsetOf, isSubsetOf, tapMethods inherited from interface org.eclipse.collections.api.collection.primitive.MutableCharCollection
removeIfMethods inherited from interface org.eclipse.collections.api.set.primitive.MutableCharSet
difference, intersect, symmetricDifference, tap, unionMethods 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:CharSetFollows the same general contract asSet.hashCode().- Specified by:
hashCodein interfaceCharSet- Specified by:
hashCodein classAbstractCharSet
-
size
public int size()Description copied from interface:PrimitiveIterableReturns the number of items in this iterable.- Specified by:
sizein interfacePrimitiveIterable
-
appendString
Description copied from interface:PrimitiveIterablePrints a string representation of this collection onto the givenAppendable. Prints the string returned byPrimitiveIterable.makeString(String, String, String).- Specified by:
appendStringin interfacePrimitiveIterable
-
add
public boolean add(char element) - Specified by:
addin interfaceMutableCharCollection
-
addAll
public boolean addAll(char... source) - Specified by:
addAllin interfaceMutableCharCollection
-
addAll
- Specified by:
addAllin interfaceMutableCharCollection
-
remove
public boolean remove(char value) - Specified by:
removein interfaceMutableCharCollection
-
removeAll
- Specified by:
removeAllin interfaceMutableCharCollection
-
removeAll
public boolean removeAll(char... source) - Specified by:
removeAllin interfaceMutableCharCollection
-
retainAll
- Specified by:
retainAllin interfaceMutableCharCollection- See Also:
-
retainAll
public boolean retainAll(char... source) - Specified by:
retainAllin interfaceMutableCharCollection- See Also:
-
clear
public void clear()- Specified by:
clearin interfaceMutableCharCollection
-
with
- Specified by:
within interfaceMutableCharCollection- Specified by:
within interfaceMutableCharSet
-
without
- Specified by:
withoutin interfaceMutableCharCollection- Specified by:
withoutin interfaceMutableCharSet
-
withAll
- Specified by:
withAllin interfaceMutableCharCollection- Specified by:
withAllin interfaceMutableCharSet
-
withoutAll
- Specified by:
withoutAllin interfaceMutableCharCollection- Specified by:
withoutAllin interfaceMutableCharSet
-
asUnmodifiable
- Specified by:
asUnmodifiablein interfaceMutableCharCollection- Specified by:
asUnmodifiablein interfaceMutableCharSet
-
asSynchronized
- Specified by:
asSynchronizedin interfaceMutableCharCollection- Specified by:
asSynchronizedin interfaceMutableCharSet
-
toImmutable
Description copied from interface:MutableCharSetReturns an immutable copy of this set.- Specified by:
toImmutablein interfaceCharSet- Specified by:
toImmutablein interfaceMutableCharCollection- Specified by:
toImmutablein interfaceMutableCharSet
-
charIterator
Description copied from interface:CharIterableReturns a primitive iterator that can be used to iterate over the CharIterable in an imperative style.- Specified by:
charIteratorin interfaceCharIterable- Specified by:
charIteratorin interfaceMutableCharCollection
-
toArray
public char[] toArray()Description copied from interface:CharIterableConverts the CharIterable to a primitive char array.- Specified by:
toArrayin interfaceCharIterable
-
toArray
public char[] toArray(char[] array) Description copied from interface:CharIterableConverts 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:
toArrayin interfaceCharIterable
-
contains
public boolean contains(char value) Description copied from interface:CharIterableReturns true if the value is contained in the CharIterable, and false if it is not.- Specified by:
containsin interfaceCharIterable
-
each
Description copied from interface:CharIterableA synonym for forEach.- Specified by:
eachin interfaceCharIterable- Since:
- 7.0.
-
select
Description copied from interface:CharIterableReturns a new CharIterable with all of the elements in the CharIterable that return true for the specified predicate.- Specified by:
selectin interfaceCharIterable- Specified by:
selectin interfaceCharSet- Specified by:
selectin interfaceMutableCharCollection- Specified by:
selectin interfaceMutableCharSet
-
select
Description copied from interface:CharIterableSame asCharIterable.select(CharPredicate), only the results are added to the target MutableCharCollection.- Specified by:
selectin interfaceCharIterable- Since:
- 8.1.
-
reject
Description copied from interface:CharIterableReturns a new CharIterable with all of the elements in the CharIterable that return false for the specified predicate.- Specified by:
rejectin interfaceCharIterable- Specified by:
rejectin interfaceCharSet- Specified by:
rejectin interfaceMutableCharCollection- Specified by:
rejectin interfaceMutableCharSet
-
reject
Description copied from interface:CharIterableSame asCharIterable.reject(CharPredicate), only the results are added to the target MutableCharCollection.- Specified by:
rejectin interfaceCharIterable- Since:
- 8.1.
-
collect
Description copied from interface:CharIterableReturns 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 interfaceCharIterable- Specified by:
collectin interfaceCharSet- Specified by:
collectin interfaceMutableCharCollection- Specified by:
collectin interfaceMutableCharSet
-
collect
Description copied from interface:CharIterableSame asCharIterable.collect(CharToObjectFunction), only the results are added to the target Collection.- Specified by:
collectin interfaceCharIterable- Since:
- 8.1.
-
detectIfNone
- Specified by:
detectIfNonein interfaceCharIterable
-
count
Description copied from interface:CharIterableReturns a count of the number of elements in the CharIterable that return true for the specified predicate.- Specified by:
countin interfaceCharIterable
-
anySatisfy
Description copied from interface:CharIterableReturns true if any of the elements in the CharIterable return true for the specified predicate, otherwise returns false.- Specified by:
anySatisfyin interfaceCharIterable
-
allSatisfy
Description copied from interface:CharIterableReturns true if all of the elements in the CharIterable return true for the specified predicate, otherwise returns false.- Specified by:
allSatisfyin interfaceCharIterable
-
sum
public long sum()- Specified by:
sumin interfaceCharIterable
-
max
public char max()- Specified by:
maxin interfaceCharIterable
-
min
public char min()- Specified by:
minin interfaceCharIterable
-
freeze
Description copied from interface:MutableCharSetReturns a frozen copy of this set. A frozen copy is the same thing as an immutable copy without safe-publish guarantees.- Specified by:
freezein interfaceCharSet- Specified by:
freezein interfaceMutableCharSet
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOException
-
injectInto
public <T> T injectInto(T injectedValue, ObjectCharToObjectFunction<? super T, ? extends T> function) - Specified by:
injectIntoin interfaceCharIterable
-
chunk
Description copied from interface:CharIterablePartitions elements in fixed size chunks.- Specified by:
chunkin interfaceCharIterable- Parameters:
size- the number of elements per chunk- Returns:
- A
RichIterablecontainingCharIterables of sizesize, except the last will be truncated if the elements don't divide evenly.
-
newEmpty
Creates a new empty CharHashSet.- Specified by:
newEmptyin interfaceMutableCharCollection- Specified by:
newEmptyin 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.
-