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:
it.unimi.dsi.fastutil.bytes.ByteCollection,it.unimi.dsi.fastutil.bytes.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:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddAll(it.unimi.dsi.fastutil.bytes.ByteCollection c) booleanaddAll(Collection<? extends Byte> c) clone()booleancontains(byte k) voidforEach(it.unimi.dsi.fastutil.bytes.ByteConsumer action) voidDeprecated.it.unimi.dsi.fastutil.ints.IntIteratorit.unimi.dsi.fastutil.ints.IntSpliteratorit.unimi.dsi.fastutil.bytes.ByteListIteratoriterator()Returns a type-specific iterator on the elements of this set.booleanremove(byte k) Removes an element from this set.booleanremoveAll(it.unimi.dsi.fastutil.bytes.ByteCollection c) booleanremoveAll(Collection<?> c) booleanremoveIf(it.unimi.dsi.fastutil.bytes.BytePredicate filter) booleanDeprecated.booleanretainAll(it.unimi.dsi.fastutil.bytes.ByteCollection c) booleanretainAll(Collection<?> c) intsize()it.unimi.dsi.fastutil.bytes.ByteSpliteratorReturns a type-specific spliterator on the elements of this set.Object[]toArray()Deprecated.byte[]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 class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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
-
Field Details
-
element
protected final byte element
-
-
Constructor Details
-
Singleton
protected Singleton(byte element)
-
-
Method Details
-
contains
public boolean contains(byte k) - Specified by:
containsin interfaceit.unimi.dsi.fastutil.bytes.ByteCollection- Overrides:
containsin classit.unimi.dsi.fastutil.bytes.AbstractByteCollection
-
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
public it.unimi.dsi.fastutil.bytes.ByteListIterator iterator()Description copied from interface:ByteSetReturns a type-specific iterator on the elements of this set.- Specified by:
iteratorin interfaceit.unimi.dsi.fastutil.bytes.ByteCollection- Specified by:
iteratorin interfaceit.unimi.dsi.fastutil.bytes.ByteIterable- 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 set.
-
spliterator
public it.unimi.dsi.fastutil.bytes.ByteSpliterator 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 interfaceit.unimi.dsi.fastutil.bytes.ByteCollection- Specified by:
spliteratorin interfaceit.unimi.dsi.fastutil.bytes.ByteIterable- Specified by:
spliteratorin interfaceByteSet- Specified by:
spliteratorin interfaceCollection<Byte>- Specified by:
spliteratorin interfaceIterable<Byte>- Specified by:
spliteratorin interfaceSet<Byte>- Returns:
-
size
public int size()- Specified by:
sizein interfaceCollection<Byte>- Specified by:
sizein interfaceSet<Byte>- Specified by:
sizein classAbstractCollection<Byte>
-
toByteArray
public byte[] toByteArray()- Specified by:
toByteArrayin interfaceit.unimi.dsi.fastutil.bytes.ByteCollection- Overrides:
toByteArrayin classit.unimi.dsi.fastutil.bytes.AbstractByteCollection
-
forEach
Deprecated. -
addAll
-
removeAll
-
retainAll
-
removeIf
Deprecated.- Specified by:
removeIfin interfaceit.unimi.dsi.fastutil.bytes.ByteCollection- Specified by:
removeIfin interfaceCollection<Byte>
-
forEach
public void forEach(it.unimi.dsi.fastutil.bytes.ByteConsumer action) - Specified by:
forEachin interfaceit.unimi.dsi.fastutil.bytes.ByteIterable
-
addAll
public boolean addAll(it.unimi.dsi.fastutil.bytes.ByteCollection c) - Specified by:
addAllin interfaceit.unimi.dsi.fastutil.bytes.ByteCollection- Overrides:
addAllin classit.unimi.dsi.fastutil.bytes.AbstractByteCollection
-
removeAll
public boolean removeAll(it.unimi.dsi.fastutil.bytes.ByteCollection c) - Specified by:
removeAllin interfaceit.unimi.dsi.fastutil.bytes.ByteCollection- Overrides:
removeAllin classit.unimi.dsi.fastutil.bytes.AbstractByteCollection
-
retainAll
public boolean retainAll(it.unimi.dsi.fastutil.bytes.ByteCollection c) - Specified by:
retainAllin interfaceit.unimi.dsi.fastutil.bytes.ByteCollection- Overrides:
retainAllin classit.unimi.dsi.fastutil.bytes.AbstractByteCollection
-
removeIf
public boolean removeIf(it.unimi.dsi.fastutil.bytes.BytePredicate filter) - Specified by:
removeIfin interfaceit.unimi.dsi.fastutil.bytes.ByteCollection
-
intIterator
public it.unimi.dsi.fastutil.ints.IntIterator intIterator()- Specified by:
intIteratorin interfaceit.unimi.dsi.fastutil.bytes.ByteCollection- Specified by:
intIteratorin interfaceit.unimi.dsi.fastutil.bytes.ByteIterable
-
intSpliterator
public it.unimi.dsi.fastutil.ints.IntSpliterator intSpliterator()- Specified by:
intSpliteratorin interfaceit.unimi.dsi.fastutil.bytes.ByteCollection- Specified by:
intSpliteratorin interfaceit.unimi.dsi.fastutil.bytes.ByteIterable
-
toArray
Deprecated.- Specified by:
toArrayin interfaceCollection<Byte>- Specified by:
toArrayin interfaceSet<Byte>- Overrides:
toArrayin classAbstractCollection<Byte>
-
clone
-