ShortCollection, ShortIterable, ShortList, ShortStack, Stack<java.lang.Short>, java.io.Serializable, java.lang.Cloneable, java.lang.Comparable<java.util.List<? extends java.lang.Short>>, java.lang.Iterable<java.lang.Short>, java.util.Collection<java.lang.Short>, java.util.List<java.lang.Short>, java.util.RandomAccesspublic static class ShortLists.Singleton extends AbstractShortList implements java.util.RandomAccess, java.io.Serializable, java.lang.Cloneable
This class may be useful to implement your own in case you subclass a type-specific list.
AbstractShortList.ShortSubList| Modifier and Type | Method | Description |
|---|---|---|
boolean |
addAll(int i,
ShortCollection c) |
Inserts all of the elements in the specified type-specific collection into
this type-specific list at the specified position (optional operation).
|
boolean |
addAll(int i,
ShortList c) |
Inserts all of the elements in the specified type-specific list into this
type-specific list at the specified position (optional operation).
|
boolean |
addAll(int i,
java.util.Collection<? extends java.lang.Short> c) |
Adds all of the elements in the specified collection to this list (optional
operation).
|
boolean |
addAll(ShortCollection c) |
Adds all elements of the given type-specific collection to this collection.
|
boolean |
addAll(ShortList c) |
Appends all of the elements in the specified type-specific list to the end of
this type-specific list (optional operation).
|
boolean |
addAll(java.util.Collection<? extends java.lang.Short> c) |
|
void |
clear() |
|
java.lang.Object |
clone() |
|
boolean |
contains(short k) |
Returns true if this list contains the specified element.
|
short |
getShort(int i) |
Returns the element at the specified position in this list.
|
ShortListIterator |
iterator() |
Returns a type-specific iterator on the elements of this collection.
|
ShortListIterator |
listIterator() |
Returns a type-specific list iterator on the list.
|
ShortListIterator |
listIterator(int i) |
Returns a type-specific list iterator on the list starting at a given index.
|
boolean |
rem(short k) |
Removes a single instance of the specified element from this collection, if
it is present (optional operation).
|
boolean |
removeAll(ShortCollection c) |
Remove from this collection all elements in the given type-specific
collection.
|
boolean |
removeAll(java.util.Collection<?> c) |
|
short |
removeShort(int i) |
Removes the element at the specified position in this list (optional
operation).
|
boolean |
retainAll(ShortCollection c) |
Retains in this collection only elements from the given type-specific
collection.
|
boolean |
retainAll(java.util.Collection<?> c) |
|
int |
size() |
|
void |
size(int size) |
Sets the size of this list.
|
ShortList |
subList(int from,
int to) |
Returns a type-specific view of the portion of this list from the index
from, inclusive, to the index to, exclusive. |
short[] |
toShortArray() |
Returns a primitive type array containing the items of this collection.
|
add, contains, containsAll, remove, toArray, toShortArrayadd, add, addElements, addElements, compareTo, equals, getElements, hashCode, indexOf, lastIndexOf, peekShort, popShort, push, removeElements, set, topShort, toStringcontainsAll, isEmpty, replaceAll, sort, spliterator, toArray, toArraycontainsAll, removeIf, removeIf, toArray, toShortArrayforEach, forEachadd, add, contains, get, indexOf, lastIndexOf, remove, remove, setpeek, pop, push, toppublic short getShort(int i)
ShortListpublic boolean rem(short k)
AbstractShortList
This implementation delegates to indexOf().
rem in interface ShortCollectionrem in class AbstractShortListList.remove(Object)public short removeShort(int i)
AbstractShortList
This implementation always throws an UnsupportedOperationException.
removeShort in interface ShortListremoveShort in class AbstractShortListList.remove(int)public boolean contains(short k)
AbstractShortList
This implementation delegates to indexOf().
contains in interface ShortCollectioncontains in class AbstractShortListList.contains(Object)public short[] toShortArray()
ShortCollectiontoShortArray in interface ShortCollectiontoShortArray in class AbstractShortCollectionCollection.toArray()public ShortListIterator listIterator()
AbstractShortList
This implementation delegates to listIterator(0).
listIterator in interface java.util.List<java.lang.Short>listIterator in interface ShortListlistIterator in class AbstractShortListList.listIterator()public ShortListIterator iterator()
AbstractShortList
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.
This implementation delegates to AbstractShortList.listIterator().
iterator in interface java.util.Collection<java.lang.Short>iterator in interface java.lang.Iterable<java.lang.Short>iterator in interface java.util.List<java.lang.Short>iterator in interface ShortCollectioniterator in interface ShortIterableiterator in interface ShortListiterator in class AbstractShortListIterable.iterator()public ShortListIterator listIterator(int i)
AbstractShortListThis implementation is based on the random-access methods.
listIterator in interface java.util.List<java.lang.Short>listIterator in interface ShortListlistIterator in class AbstractShortListList.listIterator(int)public ShortList subList(int from, int to)
ShortListfrom, inclusive, to the index to, exclusive.
Note that this specification strengthens the one given in
List.subList(int,int).
subList in interface java.util.List<java.lang.Short>subList in interface ShortListsubList in class AbstractShortListList.subList(int,int)public boolean addAll(int i,
java.util.Collection<? extends java.lang.Short> c)
AbstractShortListaddAll in interface java.util.List<java.lang.Short>addAll in class AbstractShortListpublic boolean addAll(java.util.Collection<? extends java.lang.Short> c)
AbstractShortList
This implementation delegates to the type-specific version of
List.addAll(int, Collection).
addAll in interface java.util.Collection<java.lang.Short>addAll in interface java.util.List<java.lang.Short>addAll in class AbstractShortListpublic boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<java.lang.Short>removeAll in interface java.util.List<java.lang.Short>removeAll in class java.util.AbstractCollection<java.lang.Short>public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<java.lang.Short>retainAll in interface java.util.List<java.lang.Short>retainAll in class java.util.AbstractCollection<java.lang.Short>public boolean addAll(ShortList c)
AbstractShortList
This implementation delegates to the type-specific list version of
List.addAll(int, Collection).
addAll in interface ShortListaddAll in class AbstractShortListList.add(int,Object)public boolean addAll(int i,
ShortList c)
AbstractShortList
This implementation delegates to the type-specific version of
List.addAll(int, Collection).
addAll in interface ShortListaddAll in class AbstractShortListList.add(int,Object)public boolean addAll(int i,
ShortCollection c)
ShortListaddAll in interface ShortListaddAll in class AbstractShortListList.addAll(int,java.util.Collection)public boolean addAll(ShortCollection c)
AbstractShortList
This implementation delegates to the type-specific version of
List.addAll(int, Collection).
addAll in interface ShortCollectionaddAll in class AbstractShortListc - 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 int size()
size in interface java.util.Collection<java.lang.Short>size in interface java.util.List<java.lang.Short>size in class java.util.AbstractCollection<java.lang.Short>public void size(int size)
ShortList
If the specified size is smaller than the current size, the last elements are
discarded. Otherwise, they are filled with 0/null/false.
size in interface ShortListsize in class AbstractShortListsize - the new size.public void clear()
AbstractShortList
This implementation delegates to AbstractShortList.removeElements(int, int).
clear in interface java.util.Collection<java.lang.Short>clear in interface java.util.List<java.lang.Short>clear in class AbstractShortListpublic java.lang.Object clone()