public class CharOpenHashSet extends AbstractCharSet implements ITrimmable
| Constructor and Description |
|---|
CharOpenHashSet()
Default Constructor
|
CharOpenHashSet(char[] array)
Helper constructor that allow to create a set from unboxed values
|
CharOpenHashSet(char[] array,
float loadFactor)
Helper constructor that allow to create a set from unboxed values
|
CharOpenHashSet(char[] array,
int offset,
int length)
Helper constructor that allow to create a set from unboxed values
|
CharOpenHashSet(char[] array,
int offset,
int length,
float loadFactor)
Helper constructor that allow to create a set from unboxed values
|
CharOpenHashSet(CharCollection collection)
A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
|
CharOpenHashSet(CharCollection collection,
float loadFactor)
A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
|
CharOpenHashSet(CharIterator iterator)
A Helper constructor that allows to create a set from a iterator of an unknown size
|
CharOpenHashSet(CharIterator iterator,
float loadFactor)
A Helper constructor that allows to create a set from a iterator of an unknown size
|
CharOpenHashSet(java.util.Collection<? extends java.lang.Character> collection)
Deprecated.
|
CharOpenHashSet(java.util.Collection<? extends java.lang.Character> collection,
float loadFactor)
Deprecated.
|
CharOpenHashSet(int minCapacity)
Constructor that defines the minimum capacity
|
CharOpenHashSet(int minCapacity,
float loadFactor)
Constructor that defines the minimum capacity and load factor
|
CharOpenHashSet(java.util.Iterator<java.lang.Character> iterator)
A Helper constructor that allows to create a set from a iterator of an unknown size
|
CharOpenHashSet(java.util.Iterator<java.lang.Character> iterator,
float loadFactor)
A Helper constructor that allows to create a set from a iterator of an unknown size
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(char o)
A Type-Specific add function to reduce (un)boxing
|
boolean |
addAll(CharCollection c)
A Type-Specific addAll function to reduce (un)boxing
|
boolean |
addAll(java.util.Collection<? extends java.lang.Character> c)
Deprecated.
|
void |
clear() |
void |
clearAndTrim(int size)
Trims the collection down to the requested size and clears all elements while doing so
|
boolean |
contains(char o)
A Type-Specific implementation of contains.
|
boolean |
contains(java.lang.Object o)
This default implementation delegates to the corresponding type-specific function.
|
CharOpenHashSet |
copy()
A Function that does a shallow clone of the Collection itself.
|
int |
count(Char2BooleanFunction filter)
Helper function to reduce stream usage that allows to count the valid elements.
|
char |
findFirst(Char2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for the first match.
|
void |
forEach(CharConsumer action)
A Type Specific foreach function that reduces (un)boxing
|
<E> void |
forEach(E input,
ObjectCharConsumer<E> action)
Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.
|
CharIterator |
iterator()
Returns a Type-Specific Iterator to reduce (un)boxing
|
boolean |
matchesAll(Char2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for all matches.
|
boolean |
matchesAny(Char2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for any matches.
|
boolean |
matchesNone(Char2BooleanFunction filter)
Helper function to reduce stream usage that allows to filter for no matches.
|
char |
reduce(char identity,
CharCharUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
char |
reduce(CharCharUnaryOperator operator)
Performs a reduction on the
elements of this Iterable
|
boolean |
remove(char o)
A Type Specific remove function to reduce boxing/unboxing
|
boolean |
remove(java.lang.Object o)
This default implementation delegates to the corresponding type-specific function.
|
int |
size() |
boolean |
trim(int size)
Trims the original collection down to the size of the current elements or the requested size depending which is bigger
|
equals, hashCodeadd, containsAll, containsAll, containsAny, containsAny, remChar, removeAll, removeAll, retainAll, retainAll, toCharArray, toCharArrayisEmpty, removeAll, retainAll, toArray, toArray, toStringclearAndTrim, trimadd, remChar, spliterator, synchronize, synchronize, unmodifiablecontainsAll, isEmpty, removeAll, retainAll, toArray, toArrayaddAll, addAll, addAll, containsAll, containsAny, containsAny, parallelPrimitiveStream, pour, primitiveStream, remIf, removeAll, removeAll, removeIf, retainAll, retainAll, toCharArray, toCharArrayarrayflatMap, asAsync, distinct, filter, flatMap, forEach, limit, map, peek, pourAsList, pourAsSet, sortedpublic CharOpenHashSet()
public CharOpenHashSet(int minCapacity)
minCapacity - the minimum capacity the HashSet is allowed to be.java.lang.IllegalStateException - if the minimum capacity is negativepublic CharOpenHashSet(int minCapacity,
float loadFactor)
minCapacity - the minimum capacity the HashSet is allowed to be.loadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the minimum capacity is negativejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public CharOpenHashSet(char[] array)
array - the elements that should be put into the setpublic CharOpenHashSet(char[] array,
float loadFactor)
array - the elements that should be put into the setloadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public CharOpenHashSet(char[] array,
int offset,
int length)
array - the elements that should be put into the setoffset - the starting index within the array that should be usedlength - the amount of elements used from the arrayjava.lang.IllegalStateException - if offset and length causes to step outside of the arrays rangepublic CharOpenHashSet(char[] array,
int offset,
int length,
float loadFactor)
array - the elements that should be put into the setoffset - the starting index within the array that should be usedlength - the amount of elements used from the arrayloadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1java.lang.IllegalStateException - if offset and length causes to step outside of the arrays range@Deprecated public CharOpenHashSet(java.util.Collection<? extends java.lang.Character> collection)
collection - the set the elements should be added to the Set@Deprecated
public CharOpenHashSet(java.util.Collection<? extends java.lang.Character> collection,
float loadFactor)
collection - the set the elements should be added to the SetloadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public CharOpenHashSet(CharCollection collection)
collection - the set the elements should be added to the Setpublic CharOpenHashSet(CharCollection collection, float loadFactor)
collection - the set the elements should be added to the SetloadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public CharOpenHashSet(java.util.Iterator<java.lang.Character> iterator)
iterator - the elements that should be added to the setpublic CharOpenHashSet(java.util.Iterator<java.lang.Character> iterator,
float loadFactor)
iterator - the elements that should be added to the setloadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public CharOpenHashSet(CharIterator iterator)
iterator - the elements that should be added to the setpublic CharOpenHashSet(CharIterator iterator, float loadFactor)
iterator - the elements that should be added to the setloadFactor - the percentage of how full the backing array can be before they resizejava.lang.IllegalStateException - if the loadfactor is either below/equal to 0 or above/equal to 1public boolean add(char o)
CharCollectionadd in interface CharCollectiono - the element that should be added@Deprecated public boolean addAll(java.util.Collection<? extends java.lang.Character> c)
AbstractCharCollectionThis default implementation delegates to the corresponding type-specific function.
addAll in interface java.util.Collection<java.lang.Character>addAll in interface java.util.Set<java.lang.Character>addAll in class AbstractCharCollectionpublic boolean addAll(CharCollection c)
CharCollectionaddAll in interface CharCollectionaddAll in class AbstractCharCollectionc - the collection of elements that should be addedpublic boolean contains(java.lang.Object o)
AbstractCharCollectionThis default implementation delegates to the corresponding type-specific function.
This default implementation delegates to the corresponding type-specific function.
contains in interface java.util.Collection<java.lang.Character>contains in interface java.util.Set<java.lang.Character>contains in interface CharCollectioncontains in interface CharSetcontains in class AbstractCharCollectionpublic boolean remove(java.lang.Object o)
AbstractCharCollectionThis default implementation delegates to the corresponding type-specific function.
This default implementation delegates to the corresponding type-specific function.
remove in interface java.util.Collection<java.lang.Character>remove in interface java.util.Set<java.lang.Character>remove in interface CharCollectionremove in interface CharSetremove in class AbstractCharCollectionpublic boolean contains(char o)
AbstractCharCollectioncontains in interface CharCollectioncontains in class AbstractCharCollectiono - the element that should be searched for.public boolean remove(char o)
CharSetpublic boolean trim(int size)
ITrimmabletrim in interface ITrimmablesize - the requested trim size.public void clearAndTrim(int size)
ITrimmableclearAndTrim in interface ITrimmablesize - the amount of elements that should be allowedpublic void forEach(CharConsumer action)
CharIterableforEach in interface CharIterableaction - The action to be performed for each elementIterable.forEach(Consumer)public <E> void forEach(E input,
ObjectCharConsumer<E> action)
CharIterableforEach in interface CharIterableE - the generic type of the Objectinput - the object that should be includedaction - The action to be performed for each elementpublic boolean matchesAny(Char2BooleanFunction filter)
CharIterablematchesAny in interface CharIterablefilter - that should be appliedpublic boolean matchesNone(Char2BooleanFunction filter)
CharIterablematchesNone in interface CharIterablefilter - that should be appliedpublic boolean matchesAll(Char2BooleanFunction filter)
CharIterablematchesAll in interface CharIterablefilter - that should be appliedpublic char reduce(char identity,
CharCharUnaryOperator operator)
CharIterablereduce in interface CharIterableidentity - the start valueoperator - the operation that should be appliedpublic char reduce(CharCharUnaryOperator operator)
CharIterablereduce in interface CharIterableoperator - the operation that should be appliedpublic char findFirst(Char2BooleanFunction filter)
CharIterablefindFirst in interface CharIterablefilter - that should be appliedpublic int count(Char2BooleanFunction filter)
CharIterablecount in interface CharIterablefilter - that should be appliedpublic CharIterator iterator()
CharCollectioniterator in interface java.lang.Iterable<java.lang.Character>iterator in interface java.util.Collection<java.lang.Character>iterator in interface java.util.Set<java.lang.Character>iterator in interface CharCollectioniterator in interface CharIterableiterator in interface CharSetiterator in class AbstractCharSetCollection.iterator()public CharOpenHashSet copy()
CharCollectioncopy in interface CharCollectioncopy in interface CharSetcopy in class AbstractCharSetpublic void clear()
clear in interface java.util.Collection<java.lang.Character>clear in interface java.util.Set<java.lang.Character>clear in class java.util.AbstractCollection<java.lang.Character>public int size()
size in interface java.util.Collection<java.lang.Character>size in interface java.util.Set<java.lang.Character>size in class java.util.AbstractCollection<java.lang.Character>