public static class ShortSets.Singleton extends AbstractShortSet implements Serializable, 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(Collection<? extends Short> c) |
boolean |
addAll(ShortCollection c)
Adds all elements of the given type-specific collection to this
collection.
|
Object |
clone() |
boolean |
contains(short k)
Returns
true if this collection contains the specified element. |
ShortListIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
boolean |
remove(short k)
Removes an element from this set.
|
boolean |
removeAll(Collection<?> c) |
boolean |
removeAll(ShortCollection c)
Remove from this collection all elements in the given type-specific
collection.
|
boolean |
retainAll(Collection<?> c) |
boolean |
retainAll(ShortCollection c)
Retains in this collection only elements from the given type-specific
collection.
|
int |
size() |
equals, hashCode, remadd, add, contains, containsAll, remove, shortIterator, toArray, toShortArray, toShortArray, toStringclear, containsAll, isEmpty, toArray, toArrayadd, containsAll, shortIterator, toArray, toShortArray, toShortArrayclear, containsAll, isEmpty, spliterator, toArray, toArrayparallelStream, removeIf, streampublic boolean contains(short k)
AbstractShortCollectiontrue if this collection contains the specified element.
This implementation iterates over the elements in the collection, looking for the specified element.
contains in interface ShortCollectioncontains in class AbstractShortCollectionCollection.contains(Object)public boolean remove(short k)
AbstractShortSet
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 ShortSetremove in class AbstractShortSetCollection.remove(Object)public ShortListIterator iterator()
ShortCollection
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 Collection.
iterator in interface ShortCollectioniterator in interface ShortIterableiterator in interface ShortSetiterator in interface Iterable<Short>iterator in interface Collection<Short>iterator in interface Set<Short>iterator in class AbstractShortSetIterable.iterator()public int size()
size in interface Collection<Short>size in interface Set<Short>size in class AbstractCollection<Short>public boolean addAll(Collection<? extends Short> c)
addAll in interface Collection<Short>addAll in interface Set<Short>addAll in class AbstractCollection<Short>public boolean removeAll(Collection<?> c)
removeAll in interface Collection<Short>removeAll in interface Set<Short>removeAll in class AbstractCollection<Short>public boolean retainAll(Collection<?> c)
retainAll in interface Collection<Short>retainAll in interface Set<Short>retainAll in class AbstractCollection<Short>public boolean addAll(ShortCollection c)
ShortCollectionaddAll in interface ShortCollectionaddAll in class AbstractShortCollectionc - a type-specific collection.true if this collection changed as a result of the
call.Collection.addAll(Collection)public boolean removeAll(ShortCollection c)
ShortCollectionremoveAll in interface ShortCollectionremoveAll in class AbstractShortCollectionc - a type-specific collection.true if this collection changed as a result of the
call.Collection.removeAll(Collection)public boolean retainAll(ShortCollection c)
ShortCollectionretainAll in interface ShortCollectionretainAll in class AbstractShortCollectionc - a type-specific collection.true if this collection changed as a result of the
call.Collection.retainAll(Collection)