Class CharSets.Singleton
- All Implemented Interfaces:
CharCollection,CharIterable,CharSet,Serializable,Cloneable,Iterable<Character>,Collection<Character>,Set<Character>
- Direct Known Subclasses:
CharSortedSets.Singleton
- Enclosing class:
CharSets
This class may be useful to implement your own in case you subclass a type-specific set.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds all elements of the given type-specific collection to this collection.booleanaddAll(Collection<? extends Character> c) clone()booleancontains(char k) Returnstrueif this collection contains the specified element.voidforEach(CharConsumer action) Performs the given action for each element of this type-specificIterableuntil all elements have been processed or the action throws an exception.voidDeprecated.Returns a widened primitive iterator on the elements of this collection.Returns widened primitive spliterator on the elements of this collection.iterator()Returns a type-specific iterator on the elements of this collection.booleanremove(char k) Removes an element from this set.booleanRemove from this collection all elements in the given type-specific collection.booleanremoveAll(Collection<?> c) booleanremoveIf(CharPredicate filter) Remove from this collection all elements which satisfy the given predicate.booleanDeprecated.booleanRetains in this collection only elements from the given type-specific collection.booleanretainAll(Collection<?> c) intsize()Returns a type-specific spliterator on the elements of this collection.Object[]toArray()Deprecated.char[]Returns a primitive type array containing the items of this collection.Methods inherited from class it.unimi.dsi.fastutil.chars.AbstractCharSet
equals, hashCode, remMethods inherited from class it.unimi.dsi.fastutil.chars.AbstractCharCollection
add, add, contains, containsAll, containsAll, remove, toArray, toCharArray, toStringMethods inherited from class java.util.AbstractCollection
clear, isEmpty, toArrayMethods inherited from interface it.unimi.dsi.fastutil.chars.CharCollection
add, containsAll, intParallelStream, intStream, parallelStream, removeIf, stream, toArray, toCharArrayMethods inherited from interface it.unimi.dsi.fastutil.chars.CharIterable
forEachMethods inherited from interface java.util.Collection
toArrayMethods inherited from interface java.util.Set
clear, containsAll, isEmpty, toArray
-
Method Details
-
contains
public boolean contains(char k) Description copied from class:AbstractCharCollectionReturnstrueif this collection contains the specified element.- Specified by:
containsin interfaceCharCollection- Overrides:
containsin classAbstractCharCollection- See Also:
-
remove
public boolean remove(char k) Description copied from class:AbstractCharSetRemoves an element from this set. Delegates to the type-specificrem()method implemented by type-specific abstractCollectionsuperclass.- Specified by:
removein interfaceCharSet- Overrides:
removein classAbstractCharSet- See Also:
-
iterator
Description copied from interface:CharCollectionReturns a type-specific iterator on the elements of this collection.- Specified by:
iteratorin interfaceCharCollection- Specified by:
iteratorin interfaceCharIterable- Specified by:
iteratorin interfaceCharSet- Specified by:
iteratorin interfaceCollection<Character>- Specified by:
iteratorin interfaceIterable<Character>- Specified by:
iteratorin interfaceSet<Character>- Specified by:
iteratorin classAbstractCharSet- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
-
spliterator
Description copied from interface:CharCollectionReturns a type-specific spliterator on the elements of this collection.See
Collection.spliterator()for more documentation on the requirements of the returned spliterator.- Specified by:
spliteratorin interfaceCharCollection- Specified by:
spliteratorin interfaceCharIterable- Specified by:
spliteratorin interfaceCharSet- Specified by:
spliteratorin interfaceCollection<Character>- Specified by:
spliteratorin interfaceIterable<Character>- Specified by:
spliteratorin interfaceSet<Character>- Returns:
- a type-specific spliterator on the elements of this collection.
-
size
public int size()- Specified by:
sizein interfaceCollection<Character>- Specified by:
sizein interfaceSet<Character>- Specified by:
sizein classAbstractCollection<Character>
-
toCharArray
public char[] toCharArray()Description copied from interface:CharCollectionReturns a primitive type array containing the items of this collection.- Specified by:
toCharArrayin interfaceCharCollection- Overrides:
toCharArrayin classAbstractCharCollection- Returns:
- a primitive type array containing the items of this collection.
- See Also:
-
forEach
Deprecated.Description copied from interface:CharIterable- Specified by:
forEachin interfaceCharIterable- Specified by:
forEachin interfaceIterable<Character>
-
addAll
Description copied from class:AbstractCharCollection- Specified by:
addAllin interfaceCollection<Character>- Specified by:
addAllin interfaceSet<Character>- Overrides:
addAllin classAbstractCharCollection
-
removeAll
Description copied from class:AbstractCharCollection- Specified by:
removeAllin interfaceCollection<Character>- Specified by:
removeAllin interfaceSet<Character>- Overrides:
removeAllin classAbstractCharCollection
-
retainAll
Description copied from class:AbstractCharCollection- Specified by:
retainAllin interfaceCollection<Character>- Specified by:
retainAllin interfaceSet<Character>- Overrides:
retainAllin classAbstractCharCollection
-
removeIf
Deprecated.Description copied from interface:CharCollection- Specified by:
removeIfin interfaceCharCollection- Specified by:
removeIfin interfaceCollection<Character>
-
forEach
Description copied from interface:CharIterablePerforms the given action for each element of this type-specificIterableuntil all elements have been processed or the action throws an exception.- Specified by:
forEachin interfaceCharIterable- Parameters:
action- the action to be performed for each element.- See Also:
-
addAll
Description copied from interface:CharCollectionAdds all elements of the given type-specific collection to this collection.- Specified by:
addAllin interfaceCharCollection- Overrides:
addAllin classAbstractCharCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
-
removeAll
Description copied from interface:CharCollectionRemove from this collection all elements in the given type-specific collection.- Specified by:
removeAllin interfaceCharCollection- Overrides:
removeAllin classAbstractCharCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
-
retainAll
Description copied from interface:CharCollectionRetains in this collection only elements from the given type-specific collection.- Specified by:
retainAllin interfaceCharCollection- Overrides:
retainAllin classAbstractCharCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
-
removeIf
Description copied from interface:CharCollectionRemove from this collection all elements which satisfy the given predicate.- Specified by:
removeIfin interfaceCharCollection- Parameters:
filter- a predicate which returnstruefor elements to be removed.- Returns:
trueif any elements were removed.- See Also:
-
intIterator
Description copied from interface:CharCollectionReturns a widened primitive iterator on the elements of this collection.This method is provided for the purpose of APIs that expect only the JDK's primitive iterators, of which there are only
int,long, anddouble.WARNING: This is not the same as converting the source to a sequence of code points. This returned instance literally performs
(int)(charValue)casts. Surrogate pairs will be left as separate elements instead of combined into a single element with the code point it represents. SeeCharacterfor more discussion on code points, char values, and surrogate pairs.- Specified by:
intIteratorin interfaceCharCollection- Specified by:
intIteratorin interfaceCharIterable- Returns:
- a widened primitive iterator on the elements of this collection.
-
intSpliterator
Description copied from interface:CharCollectionReturns widened primitive spliterator on the elements of this collection.This method is provided for the purpose of APIs that expect only the JDK's primitive spliterators, of which there are only
int,long, anddouble.WARNING: This is not the same as converting the source to a sequence of code points. This returned instance literally performs
(int)(charValue)casts. Surrogate pairs will be left as separate elements instead of combined into a single element with the code point it represents. SeeCharacterfor more discussion on code points, char values, and surrogate pairs.- Specified by:
intSpliteratorin interfaceCharCollection- Specified by:
intSpliteratorin interfaceCharIterable- Returns:
- a widened primitive spliterator on the elements of this collection.
-
toArray
Deprecated.- Specified by:
toArrayin interfaceCollection<Character>- Specified by:
toArrayin interfaceSet<Character>- Overrides:
toArrayin classAbstractCollection<Character>
-
clone
-