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.
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) |
void |
clear() |
boolean |
contains(byte k)
Returns
true if this collection contains the specified element. |
boolean |
containsAll(ByteCollection c)
Checks whether this collection contains all elements from the given type-specific collection.
|
boolean |
containsAll(java.util.Collection<?> c) |
boolean |
equals(java.lang.Object o) |
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.
|
int |
hashCode() |
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.
|
ByteBidirectionalIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
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 collection.
|
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] array) |
byte[] |
toByteArray()
Returns a primitive type array containing the items of this collection.
|
byte[] |
toByteArray(byte[] a)
Deprecated.
|
add, add, contains, rem, remove, toArray, toString
intParallelStream, intStream, parallelStream, removeIf, stream
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 java.lang.Object[] toArray()
toArray
in interface java.util.Collection<java.lang.Byte>
toArray
in class java.util.AbstractCollection<java.lang.Byte>
public <T> T[] toArray(T[] array)
toArray
in interface java.util.Collection<java.lang.Byte>
toArray
in class java.util.AbstractCollection<java.lang.Byte>
public ByteBidirectionalIterator iterator()
ByteCollection
iterator
in interface ByteCollection
iterator
in interface ByteIterable
iterator
in interface java.lang.Iterable<java.lang.Byte>
iterator
in interface java.util.Collection<java.lang.Byte>
iterator
in class AbstractByteCollection
Iterable.iterator()
public ByteSpliterator spliterator()
ByteCollection
See Collection.spliterator()
for more documentation on the requirements
of the returned spliterator.
public int size()
size
in interface java.util.Collection<java.lang.Byte>
size
in class java.util.AbstractCollection<java.lang.Byte>
public void clear()
clear
in interface java.util.Collection<java.lang.Byte>
clear
in class java.util.AbstractCollection<java.lang.Byte>
public int hashCode()
hashCode
in interface java.util.Collection<java.lang.Byte>
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in interface java.util.Collection<java.lang.Byte>
equals
in class java.lang.Object
@Deprecated public void forEach(java.util.function.Consumer<? super java.lang.Byte> action)
ByteIterable
public boolean containsAll(java.util.Collection<?> c)
AbstractByteCollection
containsAll
in interface java.util.Collection<java.lang.Byte>
containsAll
in class AbstractByteCollection
public boolean addAll(java.util.Collection<? extends java.lang.Byte> c)
AbstractByteCollection
addAll
in interface java.util.Collection<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 class AbstractByteCollection
public boolean retainAll(java.util.Collection<?> c)
AbstractByteCollection
retainAll
in interface java.util.Collection<java.lang.Byte>
retainAll
in class AbstractByteCollection
@Deprecated public boolean removeIf(java.util.function.Predicate<? super java.lang.Byte> filter)
ByteCollection
public byte[] toByteArray()
ByteCollection
toByteArray
in interface ByteCollection
toByteArray
in class AbstractByteCollection
Collection.toArray()
@Deprecated public byte[] toByteArray(byte[] a)
AbstractByteCollection
Note that, contrarily to Collection.toArray(Object[])
, this
methods just writes all elements of this collection: no special
value will be added after the last one.
toByteArray
in interface ByteCollection
toByteArray
in class AbstractByteCollection
a
- if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])
public void forEach(ByteConsumer action)
ByteIterable
Iterable
until all elements have been processed or the action throws an
exception.action
- the action to be performed for each element.Iterable.forEach(java.util.function.Consumer)
public boolean containsAll(ByteCollection c)
ByteCollection
containsAll
in interface ByteCollection
containsAll
in class AbstractByteCollection
c
- a type-specific collection.true
if this collection contains all elements of the argument.Collection.containsAll(Collection)
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
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
.
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
.