Package it.unimi.dsi.fastutil.bytes
Class ByteCollections.EmptyCollection
- java.lang.Object
-
- java.util.AbstractCollection<Byte>
-
- it.unimi.dsi.fastutil.bytes.AbstractByteCollection
-
- it.unimi.dsi.fastutil.bytes.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
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(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, rem, remove, toArray, toByteArray, toByteArray, toString
-
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, toArray
-
Methods inherited from interface it.unimi.dsi.fastutil.bytes.ByteCollection
removeIf, removeIf
-
Methods inherited from interface it.unimi.dsi.fastutil.bytes.ByteIterable
forEach, forEach
-
Methods inherited from interface java.util.Collection
containsAll, isEmpty, parallelStream, spliterator, stream, toArray, toArray
-
-
-
-
Method Detail
-
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
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection<Byte>- Overrides:
toArrayin classAbstractCollection<Byte>
-
iterator
public ByteBidirectionalIterator 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
public boolean equals(Object o)
- Specified by:
equalsin interfaceCollection<Byte>- Overrides:
equalsin classObject
-
addAll
public boolean addAll(Collection<? extends Byte> c)
- Specified by:
addAllin interfaceCollection<Byte>- Overrides:
addAllin classAbstractCollection<Byte>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<Byte>- Overrides:
removeAllin classAbstractCollection<Byte>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAllin interfaceCollection<Byte>- Overrides:
retainAllin classAbstractCollection<Byte>
-
addAll
public boolean addAll(ByteCollection c)
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
public boolean removeAll(ByteCollection c)
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
public boolean retainAll(ByteCollection c)
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)
-
-