public static class ShortBigLists.Singleton extends AbstractShortBigList implements Serializable, Cloneable
This class may be useful to implement your own in case you subclass a type-specific big list.
AbstractShortBigList.ShortSubList| Modifier and Type | Method and Description |
|---|---|
boolean |
addAll(Collection<? extends Short> c)
Adds all of the elements in the specified collection to this collection
(optional operation).
|
boolean |
addAll(long i,
Collection<? extends Short> c)
Adds all of the elements in the specified collection to this list
(optional operation).
|
boolean |
addAll(long i,
ShortBigList c)
Inserts all of the elements in the specified type-specific big list into
this type-specific big list at the specified position (optional
operation).
|
boolean |
addAll(long i,
ShortCollection c)
Inserts all of the elements in the specified type-specific collection
into this type-specific big list at the specified position (optional
operation).
|
boolean |
addAll(ShortBigList c)
Appends all of the elements in the specified type-specific big list to
the end of this type-specific big list (optional operation).
|
boolean |
addAll(ShortCollection c)
Adds all elements of the given type-specific collection to this
collection.
|
void |
clear()
Removes all of the elements from this collection (optional operation).
|
Object |
clone()
Creates and returns a copy of this object.
|
boolean |
contains(short k)
Returns true if this list contains the specified element.
|
short |
getShort(long i)
Returns the element at the specified position.
|
ShortBigListIterator |
listIterator()
Returns a type-specific big-list iterator on this type-specific big list.
|
ShortBigListIterator |
listIterator(long i)
Returns a type-specific list iterator on this type-specific big 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(Collection<?> c)
Removes all of this collection's elements that are also contained in the
specified collection (optional operation).
|
boolean |
removeAll(ShortCollection c)
Remove from this collection all elements in the given type-specific
collection.
|
short |
removeShort(long i)
Removes the element at the specified position.
|
boolean |
retainAll(Collection<?> c)
Retains only the elements in this collection that are contained in the
specified collection (optional operation).
|
boolean |
retainAll(ShortCollection c)
Retains in this collection only elements from the given type-specific
collection.
|
long |
size64()
Returns the size of this data structure as a long.
|
ShortBigList |
subList(long from,
long to)
Returns a type-specific view of the portion of this type-specific big
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, add, add, addElements, addElements, compareTo, equals, get, getElements, hashCode, indexOf, indexOf, iterator, lastIndexOf, lastIndexOf, peek, peekShort, pop, popShort, push, push, remove, removeElements, set, set, size, size, top, topShort, toStringadd, contains, containsAll, remove, toArray, toShortArraycontainsAll, isEmpty, toArray, toArrayadd, contains, containsAll, remove, toArray, toShortArraycontainsAll, isEmpty, parallelStream, removeIf, spliterator, stream, toArray, toArrayforEach, forEachpublic short getShort(long i)
ShortBigListgetShort in interface ShortBigListBigList.get(long)public boolean rem(short k)
AbstractShortBigList
This implementation delegates to indexOf().
rem in interface ShortCollectionrem in class AbstractShortBigListCollection.remove(Object)public short removeShort(long i)
AbstractShortBigList
This implementation always throws an
UnsupportedOperationException.
removeShort in interface ShortBigListremoveShort in class AbstractShortBigListBigList.remove(long)public boolean contains(short k)
AbstractShortBigList
This implementation delegates to indexOf().
contains in interface ShortCollectioncontains in class AbstractShortBigListCollection.contains(Object)public short[] toShortArray()
ShortCollectiontoShortArray in interface ShortCollectiontoShortArray in class AbstractShortCollectionCollection.toArray()public ShortBigListIterator listIterator()
AbstractShortBigList
Note that this specification strengthens the one given in
BigList.listIterator().
This implementation delegates to listIterator(0).
listIterator in interface BigList<Short>listIterator in interface ShortBigListlistIterator in class AbstractShortBigListBigList.listIterator()public ShortBigListIterator listIterator(long i)
AbstractShortBigList
Note that this specification strengthens the one given in
BigList.listIterator(long).
This implementation is based on the random-access methods.
listIterator in interface BigList<Short>listIterator in interface ShortBigListlistIterator in class AbstractShortBigListi - index of first element to be returned from the big-list iterator.BigList.listIterator(long)public ShortBigList subList(long from, long to)
ShortBigListfrom, inclusive, to the index to,
exclusive.
Note that this specification strengthens the one given in
BigList.subList(long,long).
subList in interface BigList<Short>subList in interface ShortBigListsubList in class AbstractShortBigListfrom - the starting element (inclusive).to - the ending element (exclusive).BigList.subList(long,long)public boolean addAll(long i,
Collection<? extends Short> c)
AbstractShortBigListaddAll in interface BigList<Short>addAll in class AbstractShortBigListi - index at which to insert the first element from the specified collection.c - collection containing elements to be added to this big list.true if this big list changed as a result of the callList.addAll(int, Collection)public boolean addAll(Collection<? extends Short> c)
AbstractShortBigListThis implementation iterates over the specified collection, and adds each object returned by the iterator to this collection, in turn.
Note that this implementation will throw an UnsupportedOperationException unless add is overridden (assuming the specified collection is non-empty).
This implementation delegates to the type-specific version of
BigList.addAll(long, Collection).
addAll in interface Collection<Short>addAll in class AbstractShortBigListc - collection containing elements to be added to this collectionAbstractCollection.add(Object)public boolean removeAll(Collection<?> c)
java.util.AbstractCollectionThis implementation iterates over this collection, checking each element returned by the iterator in turn to see if it's contained in the specified collection. If it's so contained, it's removed from this collection with the iterator's remove method.
Note that this implementation will throw an UnsupportedOperationException if the iterator returned by the iterator method does not implement the remove method and this collection contains one or more elements in common with the specified collection.
removeAll in interface Collection<Short>removeAll in class AbstractCollection<Short>c - collection containing elements to be removed from this collectionAbstractCollection.remove(Object),
AbstractCollection.contains(Object)public boolean retainAll(Collection<?> c)
java.util.AbstractCollectionThis implementation iterates over this collection, checking each element returned by the iterator in turn to see if it's contained in the specified collection. If it's not so contained, it's removed from this collection with the iterator's remove method.
Note that this implementation will throw an UnsupportedOperationException if the iterator returned by the iterator method does not implement the remove method and this collection contains one or more elements not present in the specified collection.
retainAll in interface Collection<Short>retainAll in class AbstractCollection<Short>c - collection containing elements to be retained in this collectionAbstractCollection.remove(Object),
AbstractCollection.contains(Object)public boolean addAll(ShortBigList c)
AbstractShortBigList
This implementation delegates to the type-specific list version of
AbstractShortBigList.addAll(long, Collection).
addAll in interface ShortBigListaddAll in class AbstractShortBigListList.addAll(int,java.util.Collection)public boolean addAll(long i,
ShortBigList c)
AbstractShortBigList
This implementation delegates to the type-specific version of
AbstractShortBigList.addAll(long, Collection).
addAll in interface ShortBigListaddAll in class AbstractShortBigListList.addAll(int,java.util.Collection)public boolean addAll(long i,
ShortCollection c)
AbstractShortBigList
This implementation delegates to the type-specific version of
AbstractShortBigList.addAll(long, Collection).
addAll in interface ShortBigListaddAll in class AbstractShortBigListList.addAll(int,java.util.Collection)public boolean addAll(ShortCollection c)
AbstractShortBigList
This implementation delegates to the type-specific version of
AbstractShortBigList.addAll(long, Collection).
addAll in interface ShortCollectionaddAll in class AbstractShortBigListc - 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 void clear()
AbstractShortBigListThis implementation iterates over this collection, removing each element using the Iterator.remove operation. Most implementations will probably choose to override this method for efficiency.
Note that this implementation will throw an UnsupportedOperationException if the iterator returned by this collection's iterator method does not implement the remove method and this collection is non-empty.
This implementation delegates to AbstractShortBigList.removeElements(long, long).
clear in interface Collection<Short>clear in class AbstractShortBigListpublic long size64()
Size64public Object clone()
java.lang.Objectx, the expression:
will be true, and that the expression:x.clone() != x
will bex.clone().getClass() == x.getClass()
true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x)
true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
super.clone. If a class and all of its superclasses (except
Object) obey this convention, it will be the case that
x.clone().getClass() == x.getClass().
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by super.clone before returning it. Typically, this means
copying any mutable objects that comprise the internal "deep structure"
of the object being cloned and replacing the references to these
objects with references to the copies. If a class contains only
primitive fields or references to immutable objects, then it is usually
the case that no fields in the object returned by super.clone
need to be modified.
The method clone for class Object performs a
specific cloning operation. First, if the class of this object does
not implement the interface Cloneable, then a
CloneNotSupportedException is thrown. Note that all arrays
are considered to implement the interface Cloneable and that
the return type of the clone method of an array type T[]
is T[] where T is any reference or primitive type.
Otherwise, this method creates a new instance of the class of this
object and initializes all its fields with exactly the contents of
the corresponding fields of this object, as if by assignment; the
contents of the fields are not themselves cloned. Thus, this method
performs a "shallow copy" of this object, not a "deep copy" operation.
The class Object does not itself implement the interface
Cloneable, so calling the clone method on an object
whose class is Object will result in throwing an
exception at run time.