public class CharArraySet extends AbstractCharSet implements CharOrderedSet
List.indexOf(Object) for no duplication.
Unless a array constructor is used the ArraySet does not allow for duplication.
This implementation does not shrink the backing arrayISizeProvider.CollectionSize| Constructor and Description |
|---|
CharArraySet()
Default Constructor
|
CharArraySet(char[] array)
Constructur using initial Array
|
CharArraySet(char[] array,
int length)
Constructur using initial Array
|
CharArraySet(CharCollection c)
A Helper constructor that allows to create a Set with exactly the same values as the provided collection.
|
CharArraySet(CharSet s)
A Helper constructor that fast copies the element out of a set into the ArraySet.
|
CharArraySet(java.util.Collection<? extends java.lang.Character> c)
Deprecated.
|
CharArraySet(int capacity)
Minimum Capacity Constructor
|
CharArraySet(java.util.Set<? extends java.lang.Character> s)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(char o)
A Type-Specific add function to reduce (un)boxing
|
boolean |
addAndMoveToFirst(char o)
A customized add method that allows you to insert into the first index.
|
boolean |
addAndMoveToLast(char o)
A customized add method that allows you to insert into the last index.
|
void |
clear() |
boolean |
contains(char e)
A Type-Specific implementation of contains.
|
CharArraySet |
copy()
A Function that does a shallow clone of the Collection itself.
|
int |
count(CharPredicate filter)
Helper function to reduce stream usage that allows to count the valid elements.
|
char |
findFirst(CharPredicate filter)
Helper function to reduce stream usage that allows to filter for the first match.
|
char |
firstChar()
A method to get the first element in the set
|
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.
|
void |
forEachIndexed(IntCharConsumer action)
A Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.
|
CharBidirectionalIterator |
iterator()
Returns a Type-Specific Iterator to reduce (un)boxing
|
CharBidirectionalIterator |
iterator(char fromElement)
A type Specific Iterator starting from a given key
|
char |
lastChar()
A method to get the last element in the set
|
boolean |
matchesAll(CharPredicate filter)
Helper function to reduce stream usage that allows to filter for all matches.
|
boolean |
matchesAny(CharPredicate filter)
Helper function to reduce stream usage that allows to filter for any matches.
|
boolean |
matchesNone(CharPredicate filter)
Helper function to reduce stream usage that allows to filter for no matches.
|
boolean |
moveToFirst(char o)
A specific move method to move a given key to the first index.
|
boolean |
moveToLast(char o)
A specific move method to move a given key to the last index.
|
char |
pollFirstChar()
A method to get and remove the first element in the set
|
char |
pollLastChar()
A method to get and remove the last element in the set
|
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 |
remIf(java.util.function.IntPredicate filter)
A Type-Specific removeIf function to reduce (un)boxing.
|
boolean |
remove(char o)
A Type Specific remove function to reduce boxing/unboxing
|
boolean |
removeAll(CharCollection c)
A Type-Specific implementation of removeAll.
|
boolean |
removeAll(CharCollection c,
CharConsumer r)
A Type-Specific removeAll function that reduces (un)boxing.
|
boolean |
removeAll(java.util.Collection<?> c)
Deprecated.
|
boolean |
retainAll(CharCollection c)
A Type-Specific implementation of retainAll.
|
boolean |
retainAll(CharCollection c,
CharConsumer r)
A Type-Specific retainAll function that reduces (un)boxing.
|
boolean |
retainAll(java.util.Collection<?> c)
Deprecated.
|
int |
size() |
java.lang.Object[] |
toArray()
Deprecated.
|
<E> E[] |
toArray(E[] a)
Deprecated.
|
char[] |
toCharArray(char[] a)
A Type-Specific implementation of toArray.
|
equals, hashCodeadd, addAll, addAll, contains, containsAll, containsAll, containsAny, containsAny, remChar, remove, toCharArrayspliterator, synchronize, synchronize, unmodifiableadd, contains, remChar, removeaddAll, addAll, addAll, addAll, containsAll, containsAny, containsAny, parallelPrimitiveStream, pour, primitiveStream, removeIf, toCharArrayarrayflatMap, asAsync, distinct, filter, flatMap, forEach, limit, map, peek, pourAsList, pourAsSet, repeat, sortedofpublic CharArraySet()
public CharArraySet(int capacity)
capacity - the minimum capacity of the internal arrayjava.lang.NegativeArraySizeException - if the capacity is negativepublic CharArraySet(char[] array)
array - the array that should be used for set.public CharArraySet(char[] array,
int length)
array - the array that should be used for set.length - the amount of elements present within the arrayjava.lang.NegativeArraySizeException - if the length is negative@Deprecated public CharArraySet(java.util.Collection<? extends java.lang.Character> c)
c - the elements that should be added to the set.public CharArraySet(CharCollection c)
c - the elements that should be added to the set.@Deprecated public CharArraySet(java.util.Set<? extends java.lang.Character> s)
s - the set the element should be taken frompublic CharArraySet(CharSet s)
s - the set the element should be taken frompublic boolean add(char o)
CharCollectionadd in interface CharCollectiono - the element that should be addedpublic boolean addAndMoveToFirst(char o)
CharOrderedSetaddAndMoveToFirst in interface CharOrderedSeto - the element that should be insertedSet.add(Object)public boolean addAndMoveToLast(char o)
CharOrderedSetaddAndMoveToLast in interface CharOrderedSeto - the element that should be insertedSet.add(Object)public boolean moveToFirst(char o)
CharOrderedSetmoveToFirst in interface CharOrderedSeto - that should be moved to the first indexpublic boolean moveToLast(char o)
CharOrderedSetmoveToLast in interface CharOrderedSeto - that should be moved to the first lastpublic boolean contains(char e)
AbstractCharCollectioncontains in interface CharCollectioncontains in class AbstractCharCollectione - the element that should be searched for.public char firstChar()
CharOrderedSetfirstChar in interface CharOrderedSetpublic char lastChar()
CharOrderedSetlastChar in interface CharOrderedSetpublic boolean removeAll(CharCollection c)
AbstractCharCollectionremoveAll in interface CharCollectionremoveAll in class AbstractCharCollectionc - the elements that should be deletedCollection.removeAll(Collection)public boolean removeAll(CharCollection c, CharConsumer r)
CharCollectionremoveAll in interface CharCollectionremoveAll in class AbstractCharCollectionc - the collection of elements that should be removedr - elements that got removedCollection.removeAll(Collection)public boolean retainAll(CharCollection c)
AbstractCharCollectionretainAll in interface CharCollectionretainAll in class AbstractCharCollectionc - the elements that should be keptCollection.retainAll(Collection)public boolean retainAll(CharCollection c, CharConsumer r)
CharCollectionretainAll in interface CharCollectionretainAll in class AbstractCharCollectionc - the collection of elements that should be keptr - elements that got removedCollection.retainAll(Collection)@Deprecated public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<java.lang.Character>removeAll in interface java.util.Set<java.lang.Character>removeAll in class java.util.AbstractCollection<java.lang.Character>@Deprecated public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<java.lang.Character>retainAll in interface java.util.Set<java.lang.Character>retainAll in class java.util.AbstractCollection<java.lang.Character>public boolean remove(char o)
CharSetpublic char pollFirstChar()
CharOrderedSetpollFirstChar in interface CharOrderedSetpublic char pollLastChar()
CharOrderedSetpollLastChar in interface CharOrderedSetpublic boolean remIf(java.util.function.IntPredicate filter)
CharCollectionRemoves elements that were selected by the filter
remIf in interface CharCollectionfilter - Filters the elements that should be removedCollection.removeIf(Predicate)public void forEach(CharConsumer action)
CharIterableforEach in interface CharIterableaction - The action to be performed for each elementIterable.forEach(Consumer)public void forEachIndexed(IntCharConsumer action)
CharIterableforEachIndexed in interface CharIterableaction - The action to be performed for each elementpublic <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(CharPredicate filter)
CharIterablematchesAny in interface CharIterablefilter - that should be appliedpublic boolean matchesNone(CharPredicate filter)
CharIterablematchesNone in interface CharIterablefilter - that should be appliedpublic boolean matchesAll(CharPredicate filter)
CharIterablematchesAll in interface CharIterablefilter - that should be appliedpublic char findFirst(CharPredicate filter)
CharIterablefindFirst 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 int count(CharPredicate filter)
CharIterablecount in interface CharIterablefilter - that should be appliedpublic CharBidirectionalIterator 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 CharOrderedSetiterator in interface CharSetiterator in class AbstractCharSetCollection.iterator()public CharBidirectionalIterator iterator(char fromElement)
CharOrderedSetiterator in interface CharOrderedSetfromElement - the element the iterator should start frompublic CharArraySet copy()
CharCollectioncopy in interface CharCollectioncopy in interface CharOrderedSetcopy 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 interface ISizeProvidersize in class java.util.AbstractCollection<java.lang.Character>public char[] toCharArray(char[] a)
AbstractCharCollectiontoCharArray in interface CharCollectiontoCharArray in class AbstractCharCollectiona - array that the elements should be injected to. If null or to small a new array with the right size is createdCollection.toArray(Object[])@Deprecated public java.lang.Object[] toArray()
toArray in interface java.util.Collection<java.lang.Character>toArray in interface java.util.Set<java.lang.Character>toArray in class java.util.AbstractCollection<java.lang.Character>@Deprecated public <E> E[] toArray(E[] a)
toArray in interface java.util.Collection<java.lang.Character>toArray in interface java.util.Set<java.lang.Character>toArray in class java.util.AbstractCollection<java.lang.Character>