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 | Constructor and Description |
|---|---|
protected |
EmptyCollection() |
| 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(it.unimi.dsi.fastutil.shorts.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() |
it.unimi.dsi.fastutil.ints.IntIterator |
intIterator()
Returns a widened primitive iterator on the elements of this collection.
|
it.unimi.dsi.fastutil.ints.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() |
it.unimi.dsi.fastutil.shorts.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, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitintParallelStream, intStream, parallelStream, removeIf, streamforEachpublic boolean contains(short k)
AbstractShortCollectiontrue if this collection contains the specified element.contains in interface ShortCollectioncontains in class AbstractShortCollectionCollection.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()
ShortCollectioniterator in interface ShortCollectioniterator in interface ShortIterableiterator in interface java.lang.Iterable<java.lang.Short>iterator in interface java.util.Collection<java.lang.Short>iterator in class AbstractShortCollectionIterable.iterator()public it.unimi.dsi.fastutil.shorts.ShortSpliterator spliterator()
ShortCollectionSee 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.Objectpublic 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)
ShortIterablepublic boolean containsAll(java.util.Collection<?> c)
AbstractShortCollectioncontainsAll in interface java.util.Collection<java.lang.Short>containsAll in class AbstractShortCollectionpublic boolean addAll(java.util.Collection<? extends java.lang.Short> c)
AbstractShortCollectionaddAll in interface java.util.Collection<java.lang.Short>addAll in class AbstractShortCollectionpublic boolean removeAll(java.util.Collection<?> c)
AbstractShortCollectionremoveAll in interface java.util.Collection<java.lang.Short>removeAll in class AbstractShortCollectionpublic boolean retainAll(java.util.Collection<?> c)
AbstractShortCollectionretainAll 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)
ShortCollectionpublic short[] toShortArray()
ShortCollectiontoShortArray in interface ShortCollectiontoShortArray in class AbstractShortCollectionCollection.toArray()@Deprecated public short[] toShortArray(short[] a)
AbstractShortCollectionNote 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 ShortCollectiontoShortArray in class AbstractShortCollectiona - if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])public void forEach(it.unimi.dsi.fastutil.shorts.ShortConsumer action)
ShortIterableIterable
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)
ShortCollectioncontainsAll in interface ShortCollectioncontainsAll in class AbstractShortCollectionc - a type-specific collection.true if this collection contains all elements of the argument.Collection.containsAll(Collection)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)public boolean removeIf(ShortPredicate filter)
ShortCollectionfilter - a predicate which returns true for elements to be
removed.true if any elements were removed.Collection.removeIf(java.util.function.Predicate)public it.unimi.dsi.fastutil.ints.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 it.unimi.dsi.fastutil.ints.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.