Package it.unimi.dsi.fastutil.chars
Class CharCollections.EmptyCollection
- java.lang.Object
-
- java.util.AbstractCollection<Character>
-
- it.unimi.dsi.fastutil.chars.AbstractCharCollection
-
- it.unimi.dsi.fastutil.chars.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
An immutable class representing an empty type-specific collection.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, rem, remove, toArray, toCharArray, toCharArray, toString
-
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, toArray
-
Methods inherited from interface it.unimi.dsi.fastutil.chars.CharCollection
removeIf, removeIf
-
Methods inherited from interface it.unimi.dsi.fastutil.chars.CharIterable
forEach, forEach
-
Methods inherited from interface java.util.Collection
containsAll, isEmpty, parallelStream, spliterator, stream, toArray, toArray
-
-
-
-
Method Detail
-
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
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection<Character>- Overrides:
toArrayin classAbstractCollection<Character>
-
iterator
public CharBidirectionalIterator 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
public boolean equals(Object o)
- Specified by:
equalsin interfaceCollection<Character>- Overrides:
equalsin classObject
-
addAll
public boolean addAll(Collection<? extends Character> c)
- Specified by:
addAllin interfaceCollection<Character>- Overrides:
addAllin classAbstractCollection<Character>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<Character>- Overrides:
removeAllin classAbstractCollection<Character>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAllin interfaceCollection<Character>- Overrides:
retainAllin classAbstractCollection<Character>
-
addAll
public boolean addAll(CharCollection c)
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
public boolean removeAll(CharCollection c)
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
public boolean retainAll(CharCollection c)
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)
-
-