Package it.unimi.dsi.fastutil.bytes
Class ByteSets.Singleton
java.lang.Object
java.util.AbstractCollection<Byte>
it.unimi.dsi.fastutil.bytes.AbstractByteCollection
it.unimi.dsi.fastutil.bytes.AbstractByteSet
it.unimi.dsi.fastutil.bytes.ByteSets.Singleton
- All Implemented Interfaces:
ByteCollection,ByteIterable,ByteSet,Serializable,Cloneable,Iterable<Byte>,Collection<Byte>,Set<Byte>
- Direct Known Subclasses:
ByteSortedSets.Singleton
- Enclosing class:
- ByteSets
An immutable class representing a type-specific singleton set.
This class may be useful to implement your own in case you subclass a type-specific set.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanAdds all elements of the given type-specific collection to this collection.booleanaddAll(Collection<? extends Byte> c) clone()booleancontains(byte k) Returnstrueif this collection contains the specified element.voidforEach(ByteConsumer action) Performs the given action for each element of this type-specificIterableuntil all elements have been processed or the action throws an exception.voidDeprecated.Returns a widened primitive iterator on the elements of this collection.Returns widened primitive spliterator on the elements of this collection.iterator()Returns a type-specific iterator on the elements of this collection.booleanremove(byte k) Removes an element from this set.booleanRemove from this collection all elements in the given type-specific collection.booleanremoveAll(Collection<?> c) booleanremoveIf(BytePredicate filter) Remove from this collection all elements which satisfy the given predicate.booleanDeprecated.booleanRetains in this collection only elements from the given type-specific collection.booleanretainAll(Collection<?> c) intsize()Returns a type-specific spliterator on the elements of this set.Object[]toArray()Deprecated.byte[]Returns a primitive type array containing the items of this collection.Methods inherited from class it.unimi.dsi.fastutil.bytes.AbstractByteSet
equals, hashCode, remMethods inherited from class it.unimi.dsi.fastutil.bytes.AbstractByteCollection
add, add, contains, containsAll, containsAll, remove, toArray, toByteArray, toStringMethods inherited from class java.util.AbstractCollection
clear, isEmpty, toArrayMethods inherited from interface it.unimi.dsi.fastutil.bytes.ByteCollection
add, containsAll, intParallelStream, intStream, parallelStream, removeIf, stream, toArray, toByteArrayMethods inherited from interface it.unimi.dsi.fastutil.bytes.ByteIterable
forEachMethods inherited from interface java.util.Collection
toArrayMethods inherited from interface java.util.Set
clear, containsAll, isEmpty, toArray
-
Method Details
-
contains
public boolean contains(byte k) Description copied from class:AbstractByteCollectionReturnstrueif this collection contains the specified element.- Specified by:
containsin interfaceByteCollection- Overrides:
containsin classAbstractByteCollection- See Also:
-
remove
public boolean remove(byte k) Description copied from class:AbstractByteSetRemoves an element from this set. Delegates to the type-specificrem()method implemented by type-specific abstractCollectionsuperclass.- Specified by:
removein interfaceByteSet- Overrides:
removein classAbstractByteSet- See Also:
-
iterator
Description copied from interface:ByteCollectionReturns a type-specific iterator on the elements of this collection.- Specified by:
iteratorin interfaceByteCollection- Specified by:
iteratorin interfaceByteIterable- Specified by:
iteratorin interfaceByteSet- Specified by:
iteratorin interfaceCollection<Byte>- Specified by:
iteratorin interfaceIterable<Byte>- Specified by:
iteratorin interfaceSet<Byte>- Specified by:
iteratorin classAbstractByteSet- Returns:
- a type-specific iterator on the elements of this collection.
- See Also:
-
spliterator
Description copied from interface:ByteSetReturns a type-specific spliterator on the elements of this set.Set spliterators must report at least
Spliterator.DISTINCT.See
Set.spliterator()for more documentation on the requirements of the returned spliterator.- Specified by:
spliteratorin interfaceByteCollection- Specified by:
spliteratorin interfaceByteIterable- Specified by:
spliteratorin interfaceByteSet- Specified by:
spliteratorin interfaceCollection<Byte>- Specified by:
spliteratorin interfaceIterable<Byte>- Specified by:
spliteratorin interfaceSet<Byte>- Returns:
- a type-specific spliterator on the elements of this collection.
-
size
public int size()- Specified by:
sizein interfaceCollection<Byte>- Specified by:
sizein interfaceSet<Byte>- Specified by:
sizein classAbstractCollection<Byte>
-
toByteArray
public byte[] toByteArray()Description copied from interface:ByteCollectionReturns a primitive type array containing the items of this collection.- Specified by:
toByteArrayin interfaceByteCollection- Overrides:
toByteArrayin classAbstractByteCollection- Returns:
- a primitive type array containing the items of this collection.
- See Also:
-
forEach
Deprecated.Description copied from interface:ByteIterable- Specified by:
forEachin interfaceByteIterable- Specified by:
forEachin interfaceIterable<Byte>
-
addAll
Description copied from class:AbstractByteCollection- Specified by:
addAllin interfaceCollection<Byte>- Specified by:
addAllin interfaceSet<Byte>- Overrides:
addAllin classAbstractByteCollection
-
removeAll
Description copied from class:AbstractByteCollection- Specified by:
removeAllin interfaceCollection<Byte>- Specified by:
removeAllin interfaceSet<Byte>- Overrides:
removeAllin classAbstractByteCollection
-
retainAll
Description copied from class:AbstractByteCollection- Specified by:
retainAllin interfaceCollection<Byte>- Specified by:
retainAllin interfaceSet<Byte>- Overrides:
retainAllin classAbstractByteCollection
-
removeIf
Deprecated.Description copied from interface:ByteCollection- Specified by:
removeIfin interfaceByteCollection- Specified by:
removeIfin interfaceCollection<Byte>
-
forEach
Description copied from interface:ByteIterablePerforms the given action for each element of this type-specificIterableuntil all elements have been processed or the action throws an exception.- Specified by:
forEachin interfaceByteIterable- Parameters:
action- the action to be performed for each element.- See Also:
-
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:
-
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:
-
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:
-
removeIf
Description copied from interface:ByteCollectionRemove from this collection all elements which satisfy the given predicate.- Specified by:
removeIfin interfaceByteCollection- Parameters:
filter- a predicate which returnstruefor elements to be removed.- Returns:
trueif any elements were removed.- See Also:
-
intIterator
Description copied from interface:ByteCollectionReturns 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.- Specified by:
intIteratorin interfaceByteCollection- Specified by:
intIteratorin interfaceByteIterable- Returns:
- a widened primitive iterator on the elements of this collection.
-
intSpliterator
Description copied from interface:ByteCollectionReturns 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.- Specified by:
intSpliteratorin interfaceByteCollection- Specified by:
intSpliteratorin interfaceByteIterable- Returns:
- a widened primitive spliterator on the elements of this collection.
-
toArray
Deprecated.- Specified by:
toArrayin interfaceCollection<Byte>- Specified by:
toArrayin interfaceSet<Byte>- Overrides:
toArrayin classAbstractCollection<Byte>
-
clone
-