java.lang.Object
java.util.AbstractCollection<Character>
speiger.src.collections.chars.collections.AbstractCharCollection
speiger.src.collections.chars.sets.AbstractCharSet
speiger.src.collections.chars.sets.CharArraySet
- Alle implementierten Schnittstellen:
Iterable<Character>,Collection<Character>,Set<Character>,CharCollection,CharIterable,CharOrderedSet,CharSet,ISizeProvider
A Type Specific ArraySet implementation.
That is based around the idea of
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 array-
Verschachtelte Klassen - Übersicht
Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen speiger.src.collections.utils.ISizeProvider
ISizeProvider.CollectionSize -
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungDefault ConstructorCharArraySet(char[] array) Constructur using initial ArrayCharArraySet(char[] array, int length) Constructur using initial ArrayCharArraySet(int capacity) Minimum Capacity ConstructorCharArraySet(Collection<? extends Character> c) Veraltet.CharArraySet(Set<? extends Character> s) Veraltet.A Helper constructor that allows to create a Set with exactly the same values as the provided collection.A Helper constructor that fast copies the element out of a set into the ArraySet. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungbooleanadd(char o) A Type-Specific add function to reduce (un)boxingbooleanaddAndMoveToFirst(char o) A customized add method that allows you to insert into the first index.booleanaddAndMoveToLast(char o) A customized add method that allows you to insert into the last index.voidclear()booleancontains(char e) A Type-Specific implementation of contains.copy()A Function that does a shallow clone of the Collection itself.intcount(CharPredicate filter) Helper function to reduce stream usage that allows to count the valid elements.charfindFirst(CharPredicate filter) Helper function to reduce stream usage that allows to filter for the first match.charA method to get the first element in the set<E> voidforEach(E input, ObjectCharConsumer<E> action) Helper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.voidforEach(CharConsumer action) A Type Specific foreach function that reduces (un)boxingvoidforEachIndexed(IntCharConsumer action) A Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.iterator()Returns a Type-Specific Iterator to reduce (un)boxingiterator(char fromElement) A type Specific Iterator starting from a given keycharlastChar()A method to get the last element in the setbooleanmatchesAll(CharPredicate filter) Helper function to reduce stream usage that allows to filter for all matches.booleanmatchesAny(CharPredicate filter) Helper function to reduce stream usage that allows to filter for any matches.booleanmatchesNone(CharPredicate filter) Helper function to reduce stream usage that allows to filter for no matches.booleanmoveToFirst(char o) A specific move method to move a given key to the first index.booleanmoveToLast(char o) A specific move method to move a given key to the last index.charA method to get and remove the first element in the setcharA method to get and remove the last element in the setcharreduce(char identity, CharCharUnaryOperator operator) Performs a reduction on the elements of this Iterablecharreduce(CharCharUnaryOperator operator) Performs a reduction on the elements of this IterablebooleanremIf(IntPredicate filter) A Type-Specific removeIf function to reduce (un)boxing.booleanremove(char o) A Type Specific remove function to reduce boxing/unboxingbooleanremoveAll(Collection<?> c) Veraltet.booleanA Type-Specific implementation of removeAll.booleanA Type-Specific removeAll function that reduces (un)boxing.booleanretainAll(Collection<?> c) Veraltet.booleanA Type-Specific implementation of retainAll.booleanA Type-Specific retainAll function that reduces (un)boxing.intsize()Object[]toArray()Veraltet.<E> E[]toArray(E[] a) Veraltet.char[]toCharArray(char[] a) A Type-Specific implementation of toArray.Von Klasse geerbte Methoden speiger.src.collections.chars.sets.AbstractCharSet
equals, hashCodeVon Klasse geerbte Methoden speiger.src.collections.chars.collections.AbstractCharCollection
add, addAll, addAll, contains, containsAll, containsAll, containsAny, containsAny, remChar, remove, toCharArrayVon Klasse geerbte Methoden java.util.AbstractCollection
isEmpty, toStringVon Schnittstelle geerbte Methoden speiger.src.collections.chars.collections.CharCollection
addAll, addAll, addAll, addAll, containsAll, containsAny, containsAny, parallelPrimitiveStream, pour, primitiveStream, removeIf, spliterator, toCharArrayVon Schnittstelle geerbte Methoden speiger.src.collections.chars.collections.CharIterable
arrayflatMap, asAsync, distinct, filter, flatMap, forEach, limit, map, peek, pourAsList, pourAsSet, repeat, sortedVon Schnittstelle geerbte Methoden speiger.src.collections.chars.sets.CharOrderedSet
spliterator, synchronize, synchronize, unmodifiableVon Schnittstelle geerbte Methoden speiger.src.collections.chars.sets.CharSet
add, contains, remChar, removeVon Schnittstelle geerbte Methoden java.util.Collection
parallelStream, stream, toArray
-
Konstruktordetails
-
CharArraySet
public CharArraySet()Default Constructor -
CharArraySet
public CharArraySet(int capacity) Minimum Capacity Constructor- Parameter:
capacity- the minimum capacity of the internal array- Löst aus:
NegativeArraySizeException- if the capacity is negative
-
CharArraySet
public CharArraySet(char[] array) Constructur using initial Array- Parameter:
array- the array that should be used for set.
-
CharArraySet
public CharArraySet(char[] array, int length) Constructur using initial Array- Parameter:
array- the array that should be used for set.length- the amount of elements present within the array- Löst aus:
NegativeArraySizeException- if the length is negative
-
CharArraySet
Veraltet.A Helper constructor that allows to create a Set with exactly the same values as the provided collection.- Parameter:
c- the elements that should be added to the set.- Note:
- this slowly checks every element to remove duplicates
-
CharArraySet
A Helper constructor that allows to create a Set with exactly the same values as the provided collection.- Parameter:
c- the elements that should be added to the set.- Note:
- this slowly checks every element to remove duplicates
-
CharArraySet
Veraltet.A Helper constructor that fast copies the element out of a set into the ArraySet. Since it is assumed that there is no duplication in the first place- Parameter:
s- the set the element should be taken from
-
CharArraySet
A Helper constructor that fast copies the element out of a set into the ArraySet. Since it is assumed that there is no duplication in the first place- Parameter:
s- the set the element should be taken from
-
-
Methodendetails
-
add
public boolean add(char o) Beschreibung aus Schnittstelle kopiert:CharCollectionA Type-Specific add function to reduce (un)boxing- Angegeben von:
addin SchnittstelleCharCollection- Parameter:
o- the element that should be added- Gibt zurück:
- true if the element was added to the collection
-
addAndMoveToFirst
public boolean addAndMoveToFirst(char o) Beschreibung aus Schnittstelle kopiert:CharOrderedSetA customized add method that allows you to insert into the first index.- Angegeben von:
addAndMoveToFirstin SchnittstelleCharOrderedSet- Parameter:
o- the element that should be inserted- Gibt zurück:
- true if it was added
- Siehe auch:
-
addAndMoveToLast
public boolean addAndMoveToLast(char o) Beschreibung aus Schnittstelle kopiert:CharOrderedSetA customized add method that allows you to insert into the last index.- Angegeben von:
addAndMoveToLastin SchnittstelleCharOrderedSet- Parameter:
o- the element that should be inserted- Gibt zurück:
- true if it was added
- Siehe auch:
-
moveToFirst
public boolean moveToFirst(char o) Beschreibung aus Schnittstelle kopiert:CharOrderedSetA specific move method to move a given key to the first index.- Angegeben von:
moveToFirstin SchnittstelleCharOrderedSet- Parameter:
o- that should be moved to the first index- Gibt zurück:
- true if the value was moved.
-
moveToLast
public boolean moveToLast(char o) Beschreibung aus Schnittstelle kopiert:CharOrderedSetA specific move method to move a given key to the last index.- Angegeben von:
moveToLastin SchnittstelleCharOrderedSet- Parameter:
o- that should be moved to the first last- Gibt zurück:
- true if the value was moved.
-
contains
public boolean contains(char e) Beschreibung aus Klasse kopiert:AbstractCharCollectionA Type-Specific implementation of contains. This implementation iterates over the elements and returns true if the value match.- Angegeben von:
containsin SchnittstelleCharCollection- Setzt außer Kraft:
containsin KlasseAbstractCharCollection- Parameter:
e- the element that should be searched for.- Gibt zurück:
- true if the value was found.
-
firstChar
public char firstChar()Beschreibung aus Schnittstelle kopiert:CharOrderedSetA method to get the first element in the set- Angegeben von:
firstCharin SchnittstelleCharOrderedSet- Gibt zurück:
- first element in the set
-
lastChar
public char lastChar()Beschreibung aus Schnittstelle kopiert:CharOrderedSetA method to get the last element in the set- Angegeben von:
lastCharin SchnittstelleCharOrderedSet- Gibt zurück:
- last element in the set
-
removeAll
Beschreibung aus Klasse kopiert:AbstractCharCollectionA Type-Specific implementation of removeAll. This Implementation iterates over all elements and removes them as they were found in the other collection.- Angegeben von:
removeAllin SchnittstelleCharCollection- Setzt außer Kraft:
removeAllin KlasseAbstractCharCollection- Parameter:
c- the elements that should be deleted- Gibt zurück:
- true if the collection was modified.
- Siehe auch:
-
removeAll
Beschreibung aus Schnittstelle kopiert:CharCollectionA Type-Specific removeAll function that reduces (un)boxing. It also notifies the remover of which exact element is going to be removed.- Angegeben von:
removeAllin SchnittstelleCharCollection- Setzt außer Kraft:
removeAllin KlasseAbstractCharCollection- Parameter:
c- the collection of elements that should be removedr- elements that got removed- Gibt zurück:
- true if any element was removed
- Siehe auch:
-
retainAll
Beschreibung aus Klasse kopiert:AbstractCharCollectionA Type-Specific implementation of retainAll. This Implementation iterates over all elements and removes them as they were not found in the other collection.- Angegeben von:
retainAllin SchnittstelleCharCollection- Setzt außer Kraft:
retainAllin KlasseAbstractCharCollection- Parameter:
c- the elements that should be kept- Gibt zurück:
- true if the collection was modified.
- Siehe auch:
-
retainAll
Beschreibung aus Schnittstelle kopiert:CharCollectionA Type-Specific retainAll function that reduces (un)boxing. It also notifies the remover of which exact element is going to be removed.- Angegeben von:
retainAllin SchnittstelleCharCollection- Setzt außer Kraft:
retainAllin KlasseAbstractCharCollection- Parameter:
c- the collection of elements that should be keptr- elements that got removed- Gibt zurück:
- true if any element was removed
- Siehe auch:
-
removeAll
Veraltet.- Angegeben von:
removeAllin SchnittstelleCollection<Character>- Angegeben von:
removeAllin SchnittstelleSet<Character>- Setzt außer Kraft:
removeAllin KlasseAbstractCollection<Character>
-
retainAll
Veraltet.- Angegeben von:
retainAllin SchnittstelleCollection<Character>- Angegeben von:
retainAllin SchnittstelleSet<Character>- Setzt außer Kraft:
retainAllin KlasseAbstractCollection<Character>
-
remove
public boolean remove(char o) Beschreibung aus Schnittstelle kopiert:CharSetA Type Specific remove function to reduce boxing/unboxing -
pollFirstChar
public char pollFirstChar()Beschreibung aus Schnittstelle kopiert:CharOrderedSetA method to get and remove the first element in the set- Angegeben von:
pollFirstCharin SchnittstelleCharOrderedSet- Gibt zurück:
- first element in the set
-
pollLastChar
public char pollLastChar()Beschreibung aus Schnittstelle kopiert:CharOrderedSetA method to get and remove the last element in the set- Angegeben von:
pollLastCharin SchnittstelleCharOrderedSet- Gibt zurück:
- last element in the set
-
remIf
Beschreibung aus Schnittstelle kopiert:CharCollectionA Type-Specific removeIf function to reduce (un)boxing.Removes elements that were selected by the filter
- Angegeben von:
remIfin SchnittstelleCharCollection- Parameter:
filter- Filters the elements that should be removed- Gibt zurück:
- true if the collection was modified
- Siehe auch:
-
forEach
Beschreibung aus Schnittstelle kopiert:CharIterableA Type Specific foreach function that reduces (un)boxing- Angegeben von:
forEachin SchnittstelleCharIterable- Parameter:
action- The action to be performed for each element- Siehe auch:
-
forEachIndexed
Beschreibung aus Schnittstelle kopiert:CharIterableA Indexed forEach implementation that allows you to keep track of how many elements were already iterated over.- Angegeben von:
forEachIndexedin SchnittstelleCharIterable- Parameter:
action- The action to be performed for each element
-
forEach
Beschreibung aus Schnittstelle kopiert:CharIterableHelper function to reduce Lambda usage and allow for more method references, since these are faster/cleaner.- Angegeben von:
forEachin SchnittstelleCharIterable- Typparameter:
E- the generic type of the Object- Parameter:
input- the object that should be includedaction- The action to be performed for each element
-
matchesAny
Beschreibung aus Schnittstelle kopiert:CharIterableHelper function to reduce stream usage that allows to filter for any matches.- Angegeben von:
matchesAnyin SchnittstelleCharIterable- Parameter:
filter- that should be applied- Gibt zurück:
- true if any matches were found
-
matchesNone
Beschreibung aus Schnittstelle kopiert:CharIterableHelper function to reduce stream usage that allows to filter for no matches.- Angegeben von:
matchesNonein SchnittstelleCharIterable- Parameter:
filter- that should be applied- Gibt zurück:
- true if no matches were found
-
matchesAll
Beschreibung aus Schnittstelle kopiert:CharIterableHelper function to reduce stream usage that allows to filter for all matches.- Angegeben von:
matchesAllin SchnittstelleCharIterable- Parameter:
filter- that should be applied- Gibt zurück:
- true if all matches.
-
findFirst
Beschreibung aus Schnittstelle kopiert:CharIterableHelper function to reduce stream usage that allows to filter for the first match.- Angegeben von:
findFirstin SchnittstelleCharIterable- Parameter:
filter- that should be applied- Gibt zurück:
- the found value or the null equivalent variant.
-
reduce
Beschreibung aus Schnittstelle kopiert:CharIterablePerforms a reduction on the elements of this Iterable- Angegeben von:
reducein SchnittstelleCharIterable- Parameter:
identity- the start valueoperator- the operation that should be applied- Gibt zurück:
- the reduction result, returns identity if nothing was found
-
reduce
Beschreibung aus Schnittstelle kopiert:CharIterablePerforms a reduction on the elements of this Iterable- Angegeben von:
reducein SchnittstelleCharIterable- Parameter:
operator- the operation that should be applied- Gibt zurück:
- the reduction result, returns null value if nothing was found
-
count
Beschreibung aus Schnittstelle kopiert:CharIterableHelper function to reduce stream usage that allows to count the valid elements.- Angegeben von:
countin SchnittstelleCharIterable- Parameter:
filter- that should be applied- Gibt zurück:
- the amount of Valid Elements
-
iterator
Beschreibung aus Schnittstelle kopiert:CharCollectionReturns a Type-Specific Iterator to reduce (un)boxing- Angegeben von:
iteratorin SchnittstelleCharCollection- Angegeben von:
iteratorin SchnittstelleCharIterable- Angegeben von:
iteratorin SchnittstelleCharOrderedSet- Angegeben von:
iteratorin SchnittstelleCharSet- Angegeben von:
iteratorin SchnittstelleCollection<Character>- Angegeben von:
iteratorin SchnittstelleIterable<Character>- Angegeben von:
iteratorin SchnittstelleSet<Character>- Angegeben von:
iteratorin KlasseAbstractCharSet- Gibt zurück:
- a iterator of the collection
- Siehe auch:
-
iterator
Beschreibung aus Schnittstelle kopiert:CharOrderedSetA type Specific Iterator starting from a given key- Angegeben von:
iteratorin SchnittstelleCharOrderedSet- Parameter:
fromElement- the element the iterator should start from- Gibt zurück:
- a iterator starting from the given element
-
copy
Beschreibung aus Schnittstelle kopiert:CharCollectionA Function that does a shallow clone of the Collection itself. This function is more optimized then a copy constructor since the Collection does not have to be unsorted/resorted. It can be compared to Cloneable but with less exception risk- Angegeben von:
copyin SchnittstelleCharCollection- Angegeben von:
copyin SchnittstelleCharOrderedSet- Angegeben von:
copyin SchnittstelleCharSet- Setzt außer Kraft:
copyin KlasseAbstractCharSet- Gibt zurück:
- a Shallow Copy of the collection
-
clear
public void clear()- Angegeben von:
clearin SchnittstelleCollection<Character>- Angegeben von:
clearin SchnittstelleSet<Character>- Setzt außer Kraft:
clearin KlasseAbstractCollection<Character>
-
size
public int size()- Angegeben von:
sizein SchnittstelleCollection<Character>- Angegeben von:
sizein SchnittstelleISizeProvider- Angegeben von:
sizein SchnittstelleSet<Character>- Angegeben von:
sizein KlasseAbstractCollection<Character>- Gibt zurück:
- the size of the implementing Collection
-
toCharArray
public char[] toCharArray(char[] a) Beschreibung aus Klasse kopiert:AbstractCharCollectionA Type-Specific implementation of toArray. This implementation iterates over all elements and unwraps them into primitive type.- Angegeben von:
toCharArrayin SchnittstelleCharCollection- Setzt außer Kraft:
toCharArrayin KlasseAbstractCharCollection- Parameter:
a- array that the elements should be injected to. If null or to small a new array with the right size is created- Gibt zurück:
- an array containing all of the elements in this collection
- Siehe auch:
-
toArray
Veraltet.- Angegeben von:
toArrayin SchnittstelleCollection<Character>- Angegeben von:
toArrayin SchnittstelleSet<Character>- Setzt außer Kraft:
toArrayin KlasseAbstractCollection<Character>
-
toArray
Veraltet.- Angegeben von:
toArrayin SchnittstelleCollection<Character>- Angegeben von:
toArrayin SchnittstelleSet<Character>- Setzt außer Kraft:
toArrayin KlasseAbstractCollection<Character>
-