public static class ShortCollections.UnmodifiableCollection extends java.lang.Object implements ShortCollection, java.io.Serializable
Modifier and Type | Method and Description |
---|---|
boolean |
add(short k) |
boolean |
add(java.lang.Short k) |
boolean |
addAll(java.util.Collection<? extends java.lang.Short> c) |
boolean |
addAll(ShortCollection c) |
void |
clear() |
boolean |
contains(java.lang.Object k) |
boolean |
contains(short o) |
boolean |
containsAll(java.util.Collection<?> c) |
boolean |
containsAll(ShortCollection c) |
boolean |
isEmpty() |
ShortIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
boolean |
rem(short k)
Note that this method should be called
remove() , but the clash
with the similarly named index-based method in the List interface
forces us to use a distinguished name. |
boolean |
remove(java.lang.Object ok) |
boolean |
removeAll(java.util.Collection<?> c) |
boolean |
removeAll(ShortCollection c) |
boolean |
retainAll(java.util.Collection<?> c) |
boolean |
retainAll(ShortCollection c) |
ShortIterator |
shortIterator()
Deprecated.
|
int |
size() |
java.lang.Object[] |
toArray() |
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.
|
java.lang.String |
toString() |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
public int size()
size
in interface java.util.Collection<java.lang.Short>
public boolean isEmpty()
isEmpty
in interface java.util.Collection<java.lang.Short>
public boolean contains(short o)
contains
in interface ShortCollection
Collection.contains(Object)
public ShortIterator 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 ShortCollection
iterator
in interface ShortIterable
iterator
in interface java.lang.Iterable<java.lang.Short>
iterator
in interface java.util.Collection<java.lang.Short>
@Deprecated public ShortIterator shortIterator()
ShortCollection
shortIterator
in interface ShortCollection
ShortCollection.iterator()
public boolean add(short k)
add
in interface ShortCollection
Collection.add(Object)
public boolean remove(java.lang.Object ok)
remove
in interface java.util.Collection<java.lang.Short>
public boolean addAll(java.util.Collection<? extends java.lang.Short> c)
addAll
in interface java.util.Collection<java.lang.Short>
public boolean containsAll(java.util.Collection<?> c)
containsAll
in interface java.util.Collection<java.lang.Short>
public boolean removeAll(java.util.Collection<?> c)
removeAll
in interface java.util.Collection<java.lang.Short>
public boolean retainAll(java.util.Collection<?> c)
retainAll
in interface java.util.Collection<java.lang.Short>
public void clear()
clear
in interface java.util.Collection<java.lang.Short>
public java.lang.String toString()
toString
in class java.lang.Object
public <T> T[] toArray(T[] a)
ShortCollection
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 ShortCollection
toArray
in interface java.util.Collection<java.lang.Short>
a
- if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection<java.lang.Short>
public short[] toShortArray()
ShortCollection
toShortArray
in interface ShortCollection
Collection.toArray()
public short[] toShortArray(short[] a)
ShortCollection
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
a
- if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])
public short[] toArray(short[] a)
ShortCollection
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 ShortCollection
a
- if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])
public boolean rem(short k)
ShortCollection
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()
.rem
in interface ShortCollection
Collection.remove(Object)
public boolean addAll(ShortCollection c)
addAll
in interface ShortCollection
Collection.addAll(Collection)
public boolean containsAll(ShortCollection c)
containsAll
in interface ShortCollection
Collection.containsAll(Collection)
public boolean removeAll(ShortCollection c)
removeAll
in interface ShortCollection
Collection.removeAll(Collection)
public boolean retainAll(ShortCollection c)
retainAll
in interface ShortCollection
Collection.retainAll(Collection)
public boolean add(java.lang.Short k)
add
in interface java.util.Collection<java.lang.Short>
public boolean contains(java.lang.Object k)
contains
in interface java.util.Collection<java.lang.Short>