Class CharCollections.EmptyCollection
- All Implemented Interfaces:
CharCollection,CharIterable,Iterable<Character>,Collection<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(Collection<? extends Character> c)voidclear()booleancontains(char k)Returnstrueif this collection contains the specified element.booleanequals(Object o)inthashCode()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(Collection<?> c)booleanretainAll(CharCollection c)Retains in this collection only elements from the given type-specific collection.booleanretainAll(Collection<?> c)intsize()Object[]toArray()Methods inherited from class it.unimi.dsi.fastutil.chars.AbstractCharCollection
add, add, contains, containsAll, containsAll, rem, remove, toArray, toCharArray, toCharArray, toStringMethods inherited from class java.util.AbstractCollection
isEmpty, toArrayMethods inherited from interface it.unimi.dsi.fastutil.chars.CharCollection
removeIf, removeIfMethods inherited from interface it.unimi.dsi.fastutil.chars.CharIterable
forEach, forEachMethods inherited from interface java.util.Collection
isEmpty, parallelStream, spliterator, stream, toArray, toArray
-
Method Details
-
contains
public boolean contains(char k)Description copied from class:AbstractCharCollectionReturnstrueif this collection contains the specified element.This implementation iterates over the elements in the collection, looking for the specified element.
- Specified by:
containsin interfaceCharCollection- Overrides:
containsin classAbstractCharCollection- See Also:
Collection.contains(Object)
-
toArray
- 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.Note that this specification strengthens the one given in
Iterable.iterator(), which was already strengthened in the corresponding type-specific class, but was weakened by the fact that this interface extendsCollection.- 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:
Iterable.iterator()
-
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
-
addAll
Description copied from class:AbstractCharCollectionThis implementation delegates to the type-specific version if given a type-specific collection, otherwise is uses the implementation from
AbstractCollection.- Specified by:
addAllin interfaceCollection<Character>- Overrides:
addAllin classAbstractCharCollection
-
removeAll
Description copied from class:AbstractCharCollectionThis implementation delegates to the type-specific version if given a type-specific collection, otherwise is uses the implementation from
AbstractCollection.- Specified by:
removeAllin interfaceCollection<Character>- Overrides:
removeAllin classAbstractCharCollection
-
retainAll
Description copied from class:AbstractCharCollectionThis implementation delegates to the type-specific version if given a type-specific collection, otherwise is uses the implementation from
AbstractCollection.- Specified by:
retainAllin interfaceCollection<Character>- Overrides:
retainAllin classAbstractCharCollection
-
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)
-