public interface ShortCollection extends Collection<Short>, ShortIterable
Collection; provides some additional methods that use polymorphism to avoid (un)boxing.
Additionally, this class defines strengthens (again) iterator() and defines a slightly different semantics for toArray(Object[]).
Collection| Modifier and Type | Method and Description |
|---|---|
boolean |
add(short key) |
boolean |
addAll(ShortCollection c) |
boolean |
contains(short key) |
boolean |
containsAll(ShortCollection c) |
ShortIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
boolean |
rem(short key)
|
boolean |
removeAll(ShortCollection c) |
boolean |
retainAll(ShortCollection c) |
ShortIterator |
shortIterator()
Deprecated.
As of
fastutil 5, replaced by iterator(). |
short[] |
toArray(short[] a)
Returns a primitive type array containing the items of this collection.
|
<T> T[] |
toArray(T[] a)
Returns an containing the items of this collection; the runtime type of the returned array is that of the specified array.
|
short[] |
toShortArray()
Returns a primitive type array containing the items of this collection.
|
short[] |
toShortArray(short[] a)
Returns a primitive type array containing the items of this collection.
|
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArrayShortIterator 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 Collection.
iterator in interface Collection<Short>iterator in interface Iterable<Short>iterator in interface ShortIterable@Deprecated ShortIterator shortIterator()
fastutil 5, replaced by iterator().iterator()<T> T[] toArray(T[] a)
Warning: 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.
toArray in interface Collection<Short>a - if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])boolean contains(short key)
Collection.contains(Object)short[] toShortArray()
Collection.toArray()short[] toShortArray(short[] a)
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.
a - if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])short[] toArray(short[] a)
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.
a - if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])boolean add(short key)
Collection.add(Object)boolean rem(short key)
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().Collection.remove(Object)boolean addAll(ShortCollection c)
Collection.addAll(Collection)boolean containsAll(ShortCollection c)
Collection.containsAll(Collection)boolean removeAll(ShortCollection c)
Collection.removeAll(Collection)boolean retainAll(ShortCollection c)
Collection.retainAll(Collection)