Class CharCollections.EmptyCollection
- All Implemented Interfaces:
CharCollection,it.unimi.dsi.fastutil.chars.CharIterable,java.lang.Iterable<java.lang.Character>,java.util.Collection<java.lang.Character>
- Direct Known Subclasses:
CharBigLists.EmptyBigList,CharLists.EmptyList,CharSets.EmptySet
- Enclosing class:
- CharCollections
public abstract static class CharCollections.EmptyCollection extends AbstractCharCollection
This class may be useful to implement your own in case you subclass a type-specific collection.
-
Method Summary
Modifier and Type Method Description booleanaddAll(CharCollection c)Adds all elements of the given type-specific collection to this collection.booleanaddAll(java.util.Collection<? extends java.lang.Character> c)voidclear()booleancontains(char k)Returnstrueif this collection contains the specified element.booleancontainsAll(CharCollection c)Checks whether this collection contains all elements from the given type-specific collection.booleancontainsAll(java.util.Collection<?> c)booleanequals(java.lang.Object o)voidforEach(CharConsumer action)voidforEach(java.util.function.Consumer<? super java.lang.Character> action)Deprecated.inthashCode()it.unimi.dsi.fastutil.ints.IntIteratorintIterator()Returns a widened primitive iterator on the elements of this collection.it.unimi.dsi.fastutil.ints.IntSpliteratorintSpliterator()Returns widened primitive spliterator on the elements of this collection.CharBidirectionalIteratoriterator()Returns a type-specific iterator on the elements of this collection.booleanremoveAll(CharCollection c)Remove from this collection all elements in the given type-specific collection.booleanremoveAll(java.util.Collection<?> c)booleanremoveIf(CharPredicate filter)Remove from this collection all elements which satisfy the given predicate.booleanremoveIf(java.util.function.Predicate<? super java.lang.Character> filter)Deprecated.booleanretainAll(CharCollection c)Retains in this collection only elements from the given type-specific collection.booleanretainAll(java.util.Collection<?> c)intsize()it.unimi.dsi.fastutil.chars.CharSpliteratorspliterator()Returns a type-specific spliterator on the elements of this collection.java.lang.Object[]toArray()<T> T[]toArray(T[] array)char[]toCharArray()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 class java.lang.Object
getClass, notify, notifyAll, wait, wait, waitMethods 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:
Collection.contains(Object)
-
toArray
public java.lang.Object[] toArray()- Specified by:
toArrayin interfacejava.util.Collection<java.lang.Character>- Overrides:
toArrayin classjava.util.AbstractCollection<java.lang.Character>
-
toArray
public <T> T[] toArray(T[] array)- Specified by:
toArrayin interfacejava.util.Collection<java.lang.Character>- Overrides:
toArrayin classjava.util.AbstractCollection<java.lang.Character>
-
iterator
Description copied from interface:CharCollectionReturns a type-specific iterator on the elements of this collection.- Specified by:
iteratorin interfaceCharCollection- Specified by:
iteratorin interfaceit.unimi.dsi.fastutil.chars.CharIterable- Specified by:
iteratorin interfacejava.util.Collection<java.lang.Character>- Specified by:
iteratorin interfacejava.lang.Iterable<java.lang.Character>- Specified by:
iteratorin classAbstractCharCollection- Returns:
- a type-specific iterator on the elements of this collection.
-
spliterator
public it.unimi.dsi.fastutil.chars.CharSpliterator 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 interfacejava.util.Collection<java.lang.Character>- Specified by:
sizein classjava.util.AbstractCollection<java.lang.Character>
-
clear
public void clear()- Specified by:
clearin interfacejava.util.Collection<java.lang.Character>- Overrides:
clearin classjava.util.AbstractCollection<java.lang.Character>
-
hashCode
public int hashCode()- Specified by:
hashCodein interfacejava.util.Collection<java.lang.Character>- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)- Specified by:
equalsin interfacejava.util.Collection<java.lang.Character>- Overrides:
equalsin classjava.lang.Object
-
forEach
@Deprecated public void forEach(java.util.function.Consumer<? super java.lang.Character> action)Deprecated. -
containsAll
public boolean containsAll(java.util.Collection<?> c)Description copied from class:AbstractCharCollection- Specified by:
containsAllin interfacejava.util.Collection<java.lang.Character>- Overrides:
containsAllin classAbstractCharCollection
-
addAll
public boolean addAll(java.util.Collection<? extends java.lang.Character> c)Description copied from class:AbstractCharCollection- Specified by:
addAllin interfacejava.util.Collection<java.lang.Character>- Overrides:
addAllin classAbstractCharCollection
-
removeAll
public boolean removeAll(java.util.Collection<?> c)Description copied from class:AbstractCharCollection- Specified by:
removeAllin interfacejava.util.Collection<java.lang.Character>- Overrides:
removeAllin classAbstractCharCollection
-
retainAll
public boolean retainAll(java.util.Collection<?> c)Description copied from class:AbstractCharCollection- Specified by:
retainAllin interfacejava.util.Collection<java.lang.Character>- Overrides:
retainAllin classAbstractCharCollection
-
removeIf
@Deprecated public boolean removeIf(java.util.function.Predicate<? super java.lang.Character> filter)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:
Collection.toArray()
-
toCharArray
@Deprecated public char[] toCharArray(char[] a)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:
Collection.toArray(Object[])
-
forEach
-
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:
Collection.containsAll(Collection)
-
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:
Collection.addAll(Collection)
-
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:
Collection.removeAll(Collection)
-
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:
Collection.retainAll(Collection)
-
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:
Collection.removeIf(java.util.function.Predicate)
-
intIterator
public it.unimi.dsi.fastutil.ints.IntIterator 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
public it.unimi.dsi.fastutil.ints.IntSpliterator 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.
-