public interface ByteSet extends ByteCollection, Set<Byte>
Set; provides some additional methods that use
polymorphism to avoid (un)boxing.
Additionally, this interface strengthens (again) iterator().
Set| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Byte key)
Deprecated.
Please use the corresponding type-specific method instead.
|
boolean |
contains(Object key)
Deprecated.
Please use the corresponding type-specific method instead.
|
ByteIterator |
iterator()
Returns a type-specific iterator on the elements of this set.
|
boolean |
rem(byte k)
Deprecated.
Please use
remove() instead. |
boolean |
remove(byte k)
Removes an element from this set.
|
boolean |
remove(Object key)
Deprecated.
Please use (and implement) the
rem() method instead. |
add, addAll, contains, containsAll, removeAll, retainAll, toArray, toByteArray, toByteArrayforEach, forEachaddAll, clear, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, size, spliterator, toArray, toArrayparallelStream, removeIf, streamByteIterator iterator()
Note 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 Set.
iterator in interface ByteCollectioniterator in interface ByteIterableiterator in interface Collection<Byte>iterator in interface Iterable<Byte>iterator in interface Set<Byte>Iterable.iterator()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.
Collection.remove(Object)@Deprecated boolean rem(byte k)
remove() instead.
This method is inherited from the type-specific collection this
type-specific set is based on, but it should not used as this interface
reinstates remove() as removal method.
rem in interface ByteCollectionCollection.remove(Object)@Deprecated boolean add(Byte key)
Collections that support this operation may place limitations on what elements may be added to this collection. In particular, some collections will refuse to add null elements, and others will impose restrictions on the type of elements that may be added. Collection classes should clearly specify in their documentation any restrictions on what elements may be added.
If a collection refuses to add a particular element for any reason other than that it already contains the element, it must throw an exception (rather than returning false). This preserves the invariant that a collection always contains the specified element after this call returns.
This method specification is a workaround for bug 8177440.
add in interface ByteCollectionadd in interface Collection<Byte>add in interface Set<Byte>key - element whose presence in this collection is to be ensured@Deprecated boolean contains(Object key)
This method specification is a workaround for bug 8177440.
contains in interface ByteCollectioncontains in interface Collection<Byte>contains in interface Set<Byte>key - element whose presence in this collection is to be tested@Deprecated boolean remove(Object key)
rem() method instead.This method specification is a workaround for bug 8177440.
remove in interface ByteCollectionremove in interface Collection<Byte>remove in interface Set<Byte>key - element to be removed from this collection, if present