public static class ByteSets.Singleton extends AbstractByteSet implements java.io.Serializable, java.lang.Cloneable
This class may be useful to implement your own in case you subclass a type-specific set.
Modifier and Type | Method and Description |
---|---|
boolean |
addAll(ByteCollection c)
Adds all elements of the given type-specific collection to this collection.
|
boolean |
addAll(java.util.Collection<? extends java.lang.Byte> c) |
java.lang.Object |
clone() |
boolean |
contains(byte k)
Returns
true if this collection contains the specified element. |
void |
forEach(ByteConsumer action)
Performs the given action for each element of this type-specific
Iterable
until all elements have been processed or the action throws an
exception. |
void |
forEach(java.util.function.Consumer<? super java.lang.Byte> action)
Deprecated.
|
IntIterator |
intIterator()
Returns a widened primitive iterator on the elements of this collection.
|
IntSpliterator |
intSpliterator()
Returns widened primitive spliterator on the elements of this collection.
|
ByteListIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
boolean |
remove(byte k)
Removes an element from this set.
|
boolean |
removeAll(ByteCollection c)
Remove from this collection all elements in the given type-specific collection.
|
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
removeIf(BytePredicate filter)
Remove from this collection all elements which satisfy the given predicate.
|
boolean |
removeIf(java.util.function.Predicate<? super java.lang.Byte> filter)
Deprecated.
|
boolean |
retainAll(ByteCollection c)
Retains in this collection only elements from the given type-specific collection.
|
boolean |
retainAll(java.util.Collection<?> c) |
int |
size() |
ByteSpliterator |
spliterator()
Returns a type-specific spliterator on the elements of this set.
|
java.lang.Object[] |
toArray()
Deprecated.
|
byte[] |
toByteArray()
Returns a primitive type array containing the items of this collection.
|
equals, hashCode, rem
add, add, contains, containsAll, containsAll, remove, toArray, toByteArray, toString
add, contains, of, of, of, of, of, remove
add, containsAll, intParallelStream, intStream, parallelStream, removeIf, stream, toArray, toByteArray
forEach
public boolean contains(byte k)
AbstractByteCollection
true
if this collection contains the specified element.contains
in interface ByteCollection
contains
in class AbstractByteCollection
Collection.contains(Object)
public boolean remove(byte k)
AbstractByteSet
rem()
method
implemented by type-specific abstract Collection
superclass.remove
in interface ByteSet
remove
in class AbstractByteSet
Collection.remove(Object)
public ByteListIterator iterator()
ByteCollection
iterator
in interface ByteCollection
iterator
in interface ByteIterable
iterator
in interface ByteSet
iterator
in interface java.lang.Iterable<java.lang.Byte>
iterator
in interface java.util.Collection<java.lang.Byte>
iterator
in interface java.util.Set<java.lang.Byte>
iterator
in class AbstractByteSet
Iterable.iterator()
public ByteSpliterator spliterator()
ByteSet
Set spliterators must report at least Spliterator.DISTINCT
.
See Set.spliterator()
for more documentation on the requirements
of the returned spliterator.
spliterator
in interface ByteCollection
spliterator
in interface ByteIterable
spliterator
in interface ByteSet
spliterator
in interface java.lang.Iterable<java.lang.Byte>
spliterator
in interface java.util.Collection<java.lang.Byte>
spliterator
in interface java.util.Set<java.lang.Byte>
public int size()
size
in interface java.util.Collection<java.lang.Byte>
size
in interface java.util.Set<java.lang.Byte>
size
in class java.util.AbstractCollection<java.lang.Byte>
public byte[] toByteArray()
ByteCollection
toByteArray
in interface ByteCollection
toByteArray
in class AbstractByteCollection
Collection.toArray()
@Deprecated public void forEach(java.util.function.Consumer<? super java.lang.Byte> action)
ByteIterable
forEach
in interface ByteIterable
forEach
in interface java.lang.Iterable<java.lang.Byte>
public boolean addAll(java.util.Collection<? extends java.lang.Byte> c)
AbstractByteCollection
addAll
in interface java.util.Collection<java.lang.Byte>
addAll
in interface java.util.Set<java.lang.Byte>
addAll
in class AbstractByteCollection
public boolean removeAll(java.util.Collection<?> c)
AbstractByteCollection
removeAll
in interface java.util.Collection<java.lang.Byte>
removeAll
in interface java.util.Set<java.lang.Byte>
removeAll
in class AbstractByteCollection
public boolean retainAll(java.util.Collection<?> c)
AbstractByteCollection
retainAll
in interface java.util.Collection<java.lang.Byte>
retainAll
in interface java.util.Set<java.lang.Byte>
retainAll
in class AbstractByteCollection
@Deprecated public boolean removeIf(java.util.function.Predicate<? super java.lang.Byte> filter)
ByteCollection
removeIf
in interface ByteCollection
removeIf
in interface java.util.Collection<java.lang.Byte>
public void forEach(ByteConsumer action)
ByteIterable
Iterable
until all elements have been processed or the action throws an
exception.forEach
in interface ByteIterable
action
- the action to be performed for each element.Iterable.forEach(java.util.function.Consumer)
public boolean addAll(ByteCollection c)
ByteCollection
addAll
in interface ByteCollection
addAll
in class AbstractByteCollection
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.addAll(Collection)
public boolean removeAll(ByteCollection c)
ByteCollection
removeAll
in interface ByteCollection
removeAll
in class AbstractByteCollection
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.removeAll(Collection)
public boolean retainAll(ByteCollection c)
ByteCollection
retainAll
in interface ByteCollection
retainAll
in class AbstractByteCollection
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.retainAll(Collection)
public boolean removeIf(BytePredicate filter)
ByteCollection
removeIf
in interface ByteCollection
filter
- a predicate which returns true
for elements to be
removed.true
if any elements were removed.Collection.removeIf(java.util.function.Predicate)
public IntIterator intIterator()
ByteCollection
This method is provided for the purpose of APIs that expect only the JDK's
primitive iterators, of which there are only int
, long
, and double
.
intIterator
in interface ByteCollection
intIterator
in interface ByteIterable
public IntSpliterator intSpliterator()
ByteCollection
This method is provided for the purpose of APIs that expect only the JDK's
primitive spliterators, of which there are only int
, long
, and double
.
intSpliterator
in interface ByteCollection
intSpliterator
in interface ByteIterable
@Deprecated public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<java.lang.Byte>
toArray
in interface java.util.Set<java.lang.Byte>
toArray
in class java.util.AbstractCollection<java.lang.Byte>
public java.lang.Object clone()
clone
in class java.lang.Object