public static class ShortBigLists.ListBigList extends AbstractShortBigList implements java.io.Serializable
AbstractShortBigList.ShortSubList
Modifier and Type | Method and Description |
---|---|
void |
add(long index,
short key) |
boolean |
add(short key) |
boolean |
addAll(java.util.Collection<? extends java.lang.Short> c)
Delegates to a more generic method.
|
boolean |
addAll(long index,
java.util.Collection<? extends java.lang.Short> c)
Inserts all of the elements in the specified collection into this big list at the specified position (optional operation).
|
boolean |
addAll(long index,
ShortBigList c)
Delegates to a more generic method.
|
boolean |
addAll(long index,
ShortCollection c)
Delegates to a more generic method.
|
boolean |
addAll(ShortBigList c) |
boolean |
addAll(ShortCollection c)
Adds all elements of the given type-specific collection to this collection.
|
void |
clear() |
boolean |
contains(short key) |
boolean |
containsAll(java.util.Collection<?> c)
Checks whether this collection contains all elements from the given collection.
|
boolean |
containsAll(ShortCollection c)
Checks whether this collection contains all elements from the given type-specific collection.
|
short |
getShort(long index) |
int |
hashCode()
Returns the hash code for this big list, which is identical to
List.hashCode() . |
long |
indexOf(short k) |
boolean |
isEmpty()
Checks whether the stack is empty.
|
ShortBigListIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
long |
lastIndexOf(short k) |
ShortBigListIterator |
listIterator()
Returns a type-specific big-list iterator on this type-specific big list.
|
ShortBigListIterator |
listIterator(long index)
Returns a type-specific list iterator on this type-specific big list starting at a given index.
|
boolean |
removeAll(java.util.Collection<?> c)
Remove from this collection all elements in the given collection.
|
boolean |
removeAll(ShortCollection c)
Remove from this collection all elements in the given type-specific collection.
|
void |
removeElements(long from,
long to)
Removes elements of this type-specific big list one-by-one.
|
short |
removeShort(long index) |
boolean |
retainAll(java.util.Collection<?> c)
Retains in this collection only elements from the given collection.
|
boolean |
retainAll(ShortCollection c)
Retains in this collection only elements from the given type-specific collection.
|
short |
set(long index,
short k) |
int |
size()
Deprecated.
|
void |
size(long size)
Sets the size of this big list.
|
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. |
<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.
|
add, addAll, addElements, addElements, compareTo, equals, get, getElements, getShort, indexOf, lastIndexOf, listIterator, peek, peekShort, pop, popShort, push, push, rem, remove, remove, removeShort, set, set, size, top, topShort, toString
add, contains, rem, remove, shortIterator, toArray, toArray
shortIterator, toArray
public long size64()
Size64
@Deprecated public int size()
Size64
Integer.MAX_VALUE
.size
in interface Size64
size
in interface java.util.Collection<java.lang.Short>
size
in class AbstractShortBigList
Integer.MAX_VALUE
.Collection.size()
public void size(long size)
BigList
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 BigList<java.lang.Short>
size
in class AbstractShortBigList
size
- the new size.public ShortBigListIterator 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 ShortBigList
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>
iterator
in class AbstractShortBigList
List.iterator()
public ShortBigListIterator listIterator()
ShortBigList
listIterator
in interface BigList<java.lang.Short>
listIterator
in interface ShortBigList
listIterator
in class AbstractShortBigList
List.listIterator()
public boolean addAll(long index, java.util.Collection<? extends java.lang.Short> c)
BigList
addAll
in interface BigList<java.lang.Short>
addAll
in class AbstractShortBigList
index
- 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 ShortBigListIterator listIterator(long index)
ShortBigList
listIterator
in interface BigList<java.lang.Short>
listIterator
in interface ShortBigList
listIterator
in class AbstractShortBigList
index
- index of first element to be returned from the big-list iterator.BigList.listIterator(long)
public ShortBigList subList(long from, long to)
ShortBigList
from
, inclusive, to the index to
, exclusive.
Note that this specification strengthens the one given in BigList.subList(long,long)
.
subList
in interface BigList<java.lang.Short>
subList
in interface ShortBigList
subList
in class AbstractShortBigList
from
- the starting element (inclusive).to
- the ending element (exclusive).BigList.subList(long,long)
public boolean contains(short key)
contains
in interface ShortCollection
contains
in class AbstractShortBigList
Collection.contains(Object)
public short[] toShortArray()
ShortCollection
toShortArray
in interface ShortCollection
toShortArray
in class AbstractShortCollection
Collection.toArray()
public void removeElements(long from, long to)
AbstractShortBigList
This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
removeElements
in interface ShortBigList
removeElements
in class AbstractShortBigList
from
- the start index (inclusive).to
- the end index (exclusive).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
toShortArray
in class AbstractShortCollection
a
- if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])
public void add(long index, short key)
add
in interface ShortBigList
add
in class AbstractShortBigList
List.add(int,Object)
public boolean addAll(long index, ShortCollection c)
AbstractShortBigList
addAll
in interface ShortBigList
addAll
in class AbstractShortBigList
List.addAll(int,java.util.Collection)
public boolean addAll(long index, ShortBigList c)
AbstractShortBigList
addAll
in interface ShortBigList
addAll
in class AbstractShortBigList
List.addAll(int,java.util.Collection)
public boolean add(short key)
add
in interface ShortCollection
add
in class AbstractShortBigList
Collection.add(Object)
public boolean addAll(ShortBigList c)
addAll
in interface ShortBigList
addAll
in class AbstractShortBigList
List.addAll(int,java.util.Collection)
public short getShort(long index)
getShort
in interface ShortBigList
BigList.get(long)
public long indexOf(short k)
indexOf
in interface ShortBigList
indexOf
in class AbstractShortBigList
BigList.indexOf(Object)
public long lastIndexOf(short k)
lastIndexOf
in interface ShortBigList
lastIndexOf
in class AbstractShortBigList
BigList.lastIndexOf(Object)
public short removeShort(long index)
removeShort
in interface ShortBigList
removeShort
in class AbstractShortBigList
BigList.remove(long)
public short set(long index, short k)
set
in interface ShortBigList
set
in class AbstractShortBigList
BigList.set(long,Object)
public boolean addAll(ShortCollection c)
AbstractShortCollection
addAll
in interface ShortCollection
addAll
in class AbstractShortBigList
c
- a type-specific collection.true
if this collection changed as a result of the call.Collection.addAll(Collection)
public boolean containsAll(ShortCollection c)
AbstractShortCollection
containsAll
in interface ShortCollection
containsAll
in class AbstractShortCollection
c
- a type-specific collection.true
if this collection contains all elements of the argument.Collection.containsAll(Collection)
public boolean removeAll(ShortCollection c)
AbstractShortCollection
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)
AbstractShortCollection
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 isEmpty()
Stack
isEmpty
in interface Stack<java.lang.Short>
isEmpty
in interface java.util.Collection<java.lang.Short>
isEmpty
in class AbstractShortCollection
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>
toArray
in class AbstractShortCollection
a
- if this array is big enough, it will be used to store this collection.Collection.toArray(Object[])
public boolean containsAll(java.util.Collection<?> c)
AbstractShortCollection
containsAll
in interface java.util.Collection<java.lang.Short>
containsAll
in class AbstractShortCollection
c
- a collection.true
if this collection contains all elements of the argument.public boolean addAll(java.util.Collection<? extends java.lang.Short> c)
AbstractShortBigList
addAll
in interface java.util.Collection<java.lang.Short>
addAll
in class AbstractShortBigList
c
- a collection.true
if this collection changed as a result of the call.public boolean removeAll(java.util.Collection<?> c)
AbstractShortCollection
removeAll
in interface java.util.Collection<java.lang.Short>
removeAll
in class AbstractShortCollection
c
- a collection.true
if this collection changed as a result of the call.public boolean retainAll(java.util.Collection<?> c)
AbstractShortCollection
retainAll
in interface java.util.Collection<java.lang.Short>
retainAll
in class AbstractShortCollection
c
- a collection.true
if this collection changed as a result of the call.public void clear()
clear
in interface java.util.Collection<java.lang.Short>
clear
in class java.util.AbstractCollection<java.lang.Short>
public int hashCode()
AbstractShortBigList
List.hashCode()
.hashCode
in interface java.util.Collection<java.lang.Short>
hashCode
in class AbstractShortBigList