public static class ShortSets.Singleton extends AbstractShortSet implements java.io.Serializable, java.lang.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(java.util.Collection<? extends java.lang.Short> c) |
boolean |
addAll(ShortCollection c)
Adds all elements of the given type-specific collection to this collection.
|
java.lang.Object |
clone() |
boolean |
contains(short k)
Returns
true if this collection contains the specified element. |
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. |
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.
|
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(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 set.
|
java.lang.Object[] |
toArray()
Deprecated.
|
short[] |
toShortArray()
Returns a primitive type array containing the items of this collection.
|
equals, hashCode, rem
add, add, contains, containsAll, containsAll, remove, toArray, toShortArray, toString
add, contains, of, of, of, of, of, remove
add, containsAll, intParallelStream, intStream, parallelStream, removeIf, stream, toArray, toShortArray
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 boolean remove(short k)
AbstractShortSet
rem()
method
implemented by type-specific abstract Collection
superclass.remove
in interface ShortSet
remove
in class AbstractShortSet
Collection.remove(Object)
public ShortListIterator iterator()
ShortCollection
iterator
in interface ShortCollection
iterator
in interface ShortIterable
iterator
in interface ShortSet
iterator
in interface java.lang.Iterable<java.lang.Short>
iterator
in interface java.util.Collection<java.lang.Short>
iterator
in interface java.util.Set<java.lang.Short>
iterator
in class AbstractShortSet
Iterable.iterator()
public ShortSpliterator spliterator()
ShortSet
Set spliterators must report at least Spliterator.DISTINCT
.
See Set.spliterator()
for more documentation on the requirements
of the returned spliterator.
spliterator
in interface ShortCollection
spliterator
in interface ShortIterable
spliterator
in interface ShortSet
spliterator
in interface java.lang.Iterable<java.lang.Short>
spliterator
in interface java.util.Collection<java.lang.Short>
spliterator
in interface java.util.Set<java.lang.Short>
public int size()
size
in interface java.util.Collection<java.lang.Short>
size
in interface java.util.Set<java.lang.Short>
size
in class java.util.AbstractCollection<java.lang.Short>
public short[] toShortArray()
ShortCollection
toShortArray
in interface ShortCollection
toShortArray
in class AbstractShortCollection
Collection.toArray()
@Deprecated public void forEach(java.util.function.Consumer<? super java.lang.Short> action)
ShortIterable
forEach
in interface ShortIterable
forEach
in interface java.lang.Iterable<java.lang.Short>
public boolean addAll(java.util.Collection<? extends java.lang.Short> c)
AbstractShortCollection
addAll
in interface java.util.Collection<java.lang.Short>
addAll
in interface java.util.Set<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 interface java.util.Set<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 interface java.util.Set<java.lang.Short>
retainAll
in class AbstractShortCollection
@Deprecated public boolean removeIf(java.util.function.Predicate<? super java.lang.Short> filter)
ShortCollection
removeIf
in interface ShortCollection
removeIf
in interface java.util.Collection<java.lang.Short>
public void forEach(ShortConsumer action)
ShortIterable
Iterable
until all elements have been processed or the action throws an
exception.forEach
in interface ShortIterable
action
- the action to be performed for each element.Iterable.forEach(java.util.function.Consumer)
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
removeIf
in interface 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
.
intIterator
in interface ShortCollection
intIterator
in interface ShortIterable
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
.
intSpliterator
in interface ShortCollection
intSpliterator
in interface ShortIterable
@Deprecated public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<java.lang.Short>
toArray
in interface java.util.Set<java.lang.Short>
toArray
in class java.util.AbstractCollection<java.lang.Short>
public java.lang.Object clone()
clone
in class java.lang.Object