Class CharCollections.EmptyCollection
- All Implemented Interfaces:
CharCollection,CharIterable,Iterable<Character>,Collection<Character>
- Direct Known Subclasses:
CharBigLists.EmptyBigList,CharLists.EmptyList,CharSets.EmptySet
- Enclosing class:
CharCollections
This class may be useful to implement your own in case you subclass a type-specific collection.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds all elements of the given type-specific collection to this collection.booleanaddAll(Collection<? extends Character> c) voidclear()booleancontains(char k) Returnstrueif this collection contains the specified element.booleanChecks whether this collection contains all elements from the given type-specific collection.booleancontainsAll(Collection<?> c) booleanvoidforEach(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.inthashCode()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 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()<T> T[]toArray(T[] array) char[]Returns a primitive type array containing the items of this collection.char[]toCharArray(char[] a) Deprecated.Methods inherited from class it.unimi.dsi.fastutil.chars.AbstractCharCollection
add, add, contains, rem, remove, toArray, toStringMethods inherited from class java.util.AbstractCollection
isEmptyMethods inherited from interface it.unimi.dsi.fastutil.chars.CharCollection
intParallelStream, intStream, parallelStream, removeIf, streamMethods inherited from interface it.unimi.dsi.fastutil.chars.CharIterable
forEachMethods inherited from interface java.util.Collection
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:
-
toArray
- Specified by:
toArrayin interfaceCollection<Character>- Overrides:
toArrayin classAbstractCollection<Character>
-
toArray
public <T> T[] toArray(T[] array) - Specified by:
toArrayin interfaceCollection<Character>- Overrides:
toArrayin classAbstractCollection<Character>
-
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 interfaceCollection<Character>- Specified by:
iteratorin interfaceIterable<Character>- Specified by:
iteratorin classAbstractCharCollection- 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.- Returns:
- a type-specific spliterator on the elements of this collection.
-
size
public int size()- Specified by:
sizein interfaceCollection<Character>- Specified by:
sizein classAbstractCollection<Character>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<Character>- Overrides:
clearin classAbstractCollection<Character>
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<Character>- Overrides:
hashCodein classObject
-
equals
- Specified by:
equalsin interfaceCollection<Character>- Overrides:
equalsin classObject
-
forEach
Deprecated.Description copied from interface:CharIterable -
containsAll
Description copied from class:AbstractCharCollection- Specified by:
containsAllin interfaceCollection<Character>- Overrides:
containsAllin classAbstractCharCollection
-
addAll
Description copied from class:AbstractCharCollection- Specified by:
addAllin interfaceCollection<Character>- Overrides:
addAllin classAbstractCharCollection
-
removeAll
Description copied from class:AbstractCharCollection- Specified by:
removeAllin interfaceCollection<Character>- Overrides:
removeAllin classAbstractCharCollection
-
retainAll
Description copied from class:AbstractCharCollection- Specified by:
retainAllin interfaceCollection<Character>- Overrides:
retainAllin classAbstractCharCollection
-
removeIf
Deprecated.Description copied from interface:CharCollection -
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:
-
toCharArray
Deprecated.Description copied from class:AbstractCharCollectionReturns a primitive type array containing the items of this collection.Note that, contrarily to
Collection.toArray(Object[]), this methods just writes all elements of this collection: no special value will be added after the last one.- Specified by:
toCharArrayin interfaceCharCollection- Overrides:
toCharArrayin classAbstractCharCollection- Parameters:
a- if this array is big enough, it will be used to store this collection.- Returns:
- a primitive type array containing the items of this collection.
- See Also:
-
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.- Parameters:
action- the action to be performed for each element.- See Also:
-
containsAll
Description copied from interface:CharCollectionChecks whether this collection contains all elements from the given type-specific collection.- Specified by:
containsAllin interfaceCharCollection- Overrides:
containsAllin classAbstractCharCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection contains all elements of the argument.- 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.- 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.- 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.- Returns:
- a widened primitive spliterator on the elements of this collection.
-