Class ByteCollections.EmptyCollection
- All Implemented Interfaces:
ByteCollection,ByteIterable,Iterable<Byte>,Collection<Byte>
- Direct Known Subclasses:
ByteBigLists.EmptyBigList,ByteLists.EmptyList,ByteSets.EmptySet
- Enclosing class:
- ByteCollections
public abstract static class ByteCollections.EmptyCollection extends AbstractByteCollection
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(ByteCollection c)Adds all elements of the given type-specific collection to this collection.booleanaddAll(Collection<? extends Byte> c)voidclear()booleancontains(byte k)Returnstrueif this collection contains the specified element.booleanequals(Object o)inthashCode()ByteBidirectionalIteratoriterator()Returns a type-specific iterator on the elements of this collection.booleanremoveAll(ByteCollection c)Remove from this collection all elements in the given type-specific collection.booleanremoveAll(Collection<?> c)booleanretainAll(ByteCollection 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.bytes.AbstractByteCollection
add, add, contains, containsAll, containsAll, rem, remove, toArray, toByteArray, toByteArray, toStringMethods inherited from class java.util.AbstractCollection
isEmpty, toArrayMethods inherited from interface it.unimi.dsi.fastutil.bytes.ByteCollection
removeIf, removeIfMethods inherited from interface it.unimi.dsi.fastutil.bytes.ByteIterable
forEach, forEachMethods inherited from interface java.util.Collection
isEmpty, parallelStream, spliterator, stream, toArray, toArray
-
Method Details
-
contains
public boolean contains(byte k)Description copied from class:AbstractByteCollectionReturnstrueif this collection contains the specified element.This implementation iterates over the elements in the collection, looking for the specified element.
- Specified by:
containsin interfaceByteCollection- Overrides:
containsin classAbstractByteCollection- See Also:
Collection.contains(Object)
-
toArray
- Specified by:
toArrayin interfaceCollection<Byte>- Overrides:
toArrayin classAbstractCollection<Byte>
-
iterator
Description copied from interface:ByteCollectionReturns 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 interfaceByteCollection- Specified by:
iteratorin interfaceByteIterable- Specified by:
iteratorin interfaceCollection<Byte>- Specified by:
iteratorin interfaceIterable<Byte>- Specified by:
iteratorin classAbstractByteCollection- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
Iterable.iterator()
-
size
public int size()- Specified by:
sizein interfaceCollection<Byte>- Specified by:
sizein classAbstractCollection<Byte>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<Byte>- Overrides:
clearin classAbstractCollection<Byte>
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<Byte>- Overrides:
hashCodein classObject
-
equals
- Specified by:
equalsin interfaceCollection<Byte>- Overrides:
equalsin classObject
-
addAll
Description copied from class:AbstractByteCollectionThis implementation delegates to the type-specific version if given a type-specific collection, otherwise is uses the implementation from
AbstractCollection.- Specified by:
addAllin interfaceCollection<Byte>- Overrides:
addAllin classAbstractByteCollection
-
removeAll
Description copied from class:AbstractByteCollectionThis implementation delegates to the type-specific version if given a type-specific collection, otherwise is uses the implementation from
AbstractCollection.- Specified by:
removeAllin interfaceCollection<Byte>- Overrides:
removeAllin classAbstractByteCollection
-
retainAll
Description copied from class:AbstractByteCollectionThis implementation delegates to the type-specific version if given a type-specific collection, otherwise is uses the implementation from
AbstractCollection.- Specified by:
retainAllin interfaceCollection<Byte>- Overrides:
retainAllin classAbstractByteCollection
-
addAll
Description copied from interface:ByteCollectionAdds all elements of the given type-specific collection to this collection.- Specified by:
addAllin interfaceByteCollection- Overrides:
addAllin classAbstractByteCollection- 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:ByteCollectionRemove from this collection all elements in the given type-specific collection.- Specified by:
removeAllin interfaceByteCollection- Overrides:
removeAllin classAbstractByteCollection- 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:ByteCollectionRetains in this collection only elements from the given type-specific collection.- Specified by:
retainAllin interfaceByteCollection- Overrides:
retainAllin classAbstractByteCollection- Parameters:
c- a type-specific collection.- Returns:
trueif this collection changed as a result of the call.- See Also:
Collection.retainAll(Collection)
-