public abstract class AbstractByteSet extends AbstractByteCollection implements Cloneable, ByteSet
Note that the type-specific Set interface adds a type-specific remove()
method, as it is no longer harmful for subclasses. Thus, concrete subclasses of this class
must implement remove() (the rem() implementation of this
class just delegates to remove()).
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractByteSet() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
int |
hashCode()
Returns a hash code for this set.
|
abstract ByteIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
boolean |
rem(byte k)
Deprecated.
Please use
remove() instead. |
boolean |
remove(byte k)
Removes an element from this set.
|
add, add, addAll, contains, contains, containsAll, remove, removeAll, retainAll, toArray, toByteArray, toByteArray, toStringaddAll, clear, containsAll, isEmpty, removeAll, retainAll, size, toArray, toArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, addAll, contains, containsAll, removeAll, removeIf, removeIf, retainAll, toArray, toByteArray, toByteArrayforEach, forEachaddAll, clear, containsAll, isEmpty, removeAll, retainAll, size, spliterator, toArray, toArrayparallelStream, streampublic abstract ByteIterator 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 ByteSetiterator in interface Iterable<Byte>iterator in interface Collection<Byte>iterator in interface Set<Byte>iterator in class AbstractByteCollectionIterable.iterator()public boolean equals(Object o)
public int hashCode()
public boolean remove(byte k)
Note that the corresponding method of a type-specific collection is rem().
This unfortunate situation is caused by the clash
with the similarly named index-based method in the List interface.
Delegates to the type-specific rem() method
implemented by type-specific abstract Collection superclass.
remove in interface ByteSetCollection.remove(Object)@Deprecated public boolean rem(byte k)
remove() instead.Note that this method should be called remove(), 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().
This implementation iterates over the elements in the collection,
looking for the specified element and tries to remove it.
Delegates to the type-specific remove() method
specified in the type-specific Set interface.
rem in interface ByteCollectionrem in interface ByteSetrem in class AbstractByteCollectionCollection.remove(Object)Copyright © 2020. All rights reserved.