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 |
add(byte k) |
boolean |
addAll(ByteCollection c)
Adds all elements of the given type-specific collection to this collection.
|
void |
clear() |
boolean |
contains(byte k) |
boolean |
containsAll(ByteCollection c)
Checks whether this collection contains all elements from the given type-specific collection.
|
boolean |
equals(Object o) |
int |
hashCode() |
ByteBidirectionalIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
boolean |
rem(byte k)
|
boolean |
removeAll(ByteCollection c)
Remove from this collection all elements in the given type-specific collection.
|
boolean |
retainAll(ByteCollection c)
Retains in this collection only elements from the given type-specific collection.
|
int |
size() |
Object[] |
toArray() |
byte[] |
toByteArray()
Returns a primitive type array containing the items of this collection.
|
byte[] |
toByteArray(byte[] a)
Returns a primitive type array containing the items of this collection.
|
add, addAll, byteIterator, contains, containsAll, isEmpty, rem, remove, removeAll, retainAll, toArray, toArray, toStringparallelStream, removeIf, spliterator, streampublic boolean add(byte k)
add in interface ByteCollectionadd in class AbstractByteCollectionCollection.add(Object)public boolean contains(byte k)
contains in interface ByteCollectioncontains in class AbstractByteCollectionCollection.contains(Object)public Object[] toArray()
toArray in interface Collection<Byte>toArray in class AbstractByteCollectionpublic byte[] toByteArray(byte[] a)
ByteCollectionNote 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 ByteCollectiontoByteArray in class AbstractByteCollectiona - if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])public byte[] toByteArray()
ByteCollectiontoByteArray in interface ByteCollectiontoByteArray in class AbstractByteCollectionCollection.toArray()public boolean rem(byte k)
ByteCollectionremove(), but the clash with the similarly named index-based method in the List interface
forces us to use a distinguished name. For simplicity, the set interfaces reinstates remove().rem in interface ByteCollectionrem in class AbstractByteCollectionCollection.remove(Object)public boolean addAll(ByteCollection c)
AbstractByteCollectionaddAll in interface ByteCollectionaddAll in class AbstractByteCollectionc - a type-specific collection.true if this collection changed as a result of the call.Collection.addAll(Collection)public boolean removeAll(ByteCollection c)
AbstractByteCollectionremoveAll in interface ByteCollectionremoveAll in class AbstractByteCollectionc - a type-specific collection.true if this collection changed as a result of the call.Collection.removeAll(Collection)public boolean retainAll(ByteCollection c)
AbstractByteCollectionretainAll in interface ByteCollectionretainAll in class AbstractByteCollectionc - a type-specific collection.true if this collection changed as a result of the call.Collection.retainAll(Collection)public boolean containsAll(ByteCollection c)
AbstractByteCollectioncontainsAll in interface ByteCollectioncontainsAll in class AbstractByteCollectionc - a type-specific collection.true if this collection contains all elements of the argument.Collection.containsAll(Collection)public ByteBidirectionalIterator iterator()
ByteCollectionNote 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 extends Collection.
iterator in interface ByteCollectioniterator in interface ByteIterableiterator in interface Iterable<Byte>iterator in interface Collection<Byte>iterator in class AbstractByteCollectionpublic int size()
size in interface Collection<Byte>size in class AbstractCollection<Byte>public void clear()
clear in interface Collection<Byte>clear in class AbstractCollection<Byte>public int hashCode()
hashCode in interface Collection<Byte>hashCode in class Object