public abstract static class ShortCollections.EmptyCollection extends AbstractShortCollection
This class may be useful to implement your own in case you subclass a type-specific collection.
Modifier and Type | Method and Description |
---|---|
boolean |
addAll(java.util.Collection<? extends java.lang.Short> c) |
boolean |
addAll(ShortCollection c)
Adds all elements of the given type-specific collection to this collection.
|
void |
clear() |
boolean |
contains(short k)
Returns
true if this collection contains the specified element. |
boolean |
containsAll(java.util.Collection<?> c) |
boolean |
containsAll(ShortCollection c)
Checks whether this collection contains all elements from the given type-specific collection.
|
boolean |
equals(java.lang.Object o) |
void |
forEach(java.util.function.Consumer<? super java.lang.Short> action)
Deprecated.
|
void |
forEach(ShortConsumer action)
Performs the given action for each element of this type-specific
Iterable
until all elements have been processed or the action throws an
exception. |
int |
hashCode() |
IntIterator |
intIterator()
Returns a widened primitive iterator on the elements of this collection.
|
IntSpliterator |
intSpliterator()
Returns widened primitive spliterator on the elements of this collection.
|
ShortBidirectionalIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
removeAll(ShortCollection c)
Remove from this collection all elements in the given type-specific collection.
|
boolean |
removeIf(java.util.function.Predicate<? super java.lang.Short> filter)
Deprecated.
|
boolean |
removeIf(ShortPredicate filter)
Remove from this collection all elements which satisfy the given predicate.
|
boolean |
retainAll(java.util.Collection<?> c) |
boolean |
retainAll(ShortCollection c)
Retains in this collection only elements from the given type-specific collection.
|
int |
size() |
ShortSpliterator |
spliterator()
Returns a type-specific spliterator on the elements of this collection.
|
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] array) |
short[] |
toShortArray()
Returns a primitive type array containing the items of this collection.
|
short[] |
toShortArray(short[] a)
Deprecated.
|
add, add, contains, rem, remove, toArray, toString
intParallelStream, intStream, parallelStream, removeIf, stream
forEach
public boolean contains(short k)
AbstractShortCollection
true
if this collection contains the specified element.contains
in interface ShortCollection
contains
in class AbstractShortCollection
Collection.contains(Object)
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<java.lang.Short>
toArray
in class java.util.AbstractCollection<java.lang.Short>
public <T> T[] toArray(T[] array)
toArray
in interface java.util.Collection<java.lang.Short>
toArray
in class java.util.AbstractCollection<java.lang.Short>
public ShortBidirectionalIterator iterator()
ShortCollection
iterator
in interface ShortCollection
iterator
in interface ShortIterable
iterator
in interface java.lang.Iterable<java.lang.Short>
iterator
in interface java.util.Collection<java.lang.Short>
iterator
in class AbstractShortCollection
Iterable.iterator()
public ShortSpliterator spliterator()
ShortCollection
See Collection.spliterator()
for more documentation on the requirements
of the returned spliterator.
public int size()
size
in interface java.util.Collection<java.lang.Short>
size
in class java.util.AbstractCollection<java.lang.Short>
public void clear()
clear
in interface java.util.Collection<java.lang.Short>
clear
in class java.util.AbstractCollection<java.lang.Short>
public int hashCode()
hashCode
in interface java.util.Collection<java.lang.Short>
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in interface java.util.Collection<java.lang.Short>
equals
in class java.lang.Object
@Deprecated public void forEach(java.util.function.Consumer<? super java.lang.Short> action)
ShortIterable
public boolean containsAll(java.util.Collection<?> c)
AbstractShortCollection
containsAll
in interface java.util.Collection<java.lang.Short>
containsAll
in class AbstractShortCollection
public boolean addAll(java.util.Collection<? extends java.lang.Short> c)
AbstractShortCollection
addAll
in interface java.util.Collection<java.lang.Short>
addAll
in class AbstractShortCollection
public boolean removeAll(java.util.Collection<?> c)
AbstractShortCollection
removeAll
in interface java.util.Collection<java.lang.Short>
removeAll
in class AbstractShortCollection
public boolean retainAll(java.util.Collection<?> c)
AbstractShortCollection
retainAll
in interface java.util.Collection<java.lang.Short>
retainAll
in class AbstractShortCollection
@Deprecated public boolean removeIf(java.util.function.Predicate<? super java.lang.Short> filter)
ShortCollection
public short[] toShortArray()
ShortCollection
toShortArray
in interface ShortCollection
toShortArray
in class AbstractShortCollection
Collection.toArray()
@Deprecated public short[] toShortArray(short[] a)
AbstractShortCollection
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.
toShortArray
in interface ShortCollection
toShortArray
in class AbstractShortCollection
a
- if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])
public void forEach(ShortConsumer action)
ShortIterable
Iterable
until all elements have been processed or the action throws an
exception.action
- the action to be performed for each element.Iterable.forEach(java.util.function.Consumer)
public boolean containsAll(ShortCollection c)
ShortCollection
containsAll
in interface ShortCollection
containsAll
in class AbstractShortCollection
c
- a type-specific collection.true
if this collection contains all elements of the argument.Collection.containsAll(Collection)
public boolean addAll(ShortCollection c)
ShortCollection
addAll
in interface ShortCollection
addAll
in class AbstractShortCollection
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.addAll(Collection)
public boolean removeAll(ShortCollection c)
ShortCollection
removeAll
in interface ShortCollection
removeAll
in class AbstractShortCollection
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.removeAll(Collection)
public boolean retainAll(ShortCollection c)
ShortCollection
retainAll
in interface ShortCollection
retainAll
in class AbstractShortCollection
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.retainAll(Collection)
public boolean removeIf(ShortPredicate filter)
ShortCollection
filter
- a predicate which returns true
for elements to be
removed.true
if any elements were removed.Collection.removeIf(java.util.function.Predicate)
public IntIterator intIterator()
ShortCollection
This method is provided for the purpose of APIs that expect only the JDK's
primitive iterators, of which there are only int
, long
, and double
.
public IntSpliterator intSpliterator()
ShortCollection
This method is provided for the purpose of APIs that expect only the JDK's
primitive spliterators, of which there are only int
, long
, and double
.