public abstract class AbstractShortBigList extends it.unimi.dsi.fastutil.shorts.AbstractShortCollection implements ShortBigList, it.unimi.dsi.fastutil.shorts.ShortStack
Most of the methods in this class are optimized with the assumption that the List will have
have constant-time random access. If this is not the case, you
should probably at least override listIterator(long) and the xAll() methods
(such as addAll(long, java.util.Collection<? extends java.lang.Short>)) with a more appropriate iteration scheme. Note the subList(long, long)
method is cognizant of random-access or not, so that need not be reimplemented.
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractShortBigList.ShortRandomAccessSubList |
static class |
AbstractShortBigList.ShortSubList
A class implementing a sublist view.
|
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractShortBigList() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(long index,
short k)
Inserts the specified element at the specified position in this type-specific big list (optional operation).
|
void |
add(long index,
java.lang.Short ok)
Deprecated.
Please use the corresponding type-specific method instead.
|
boolean |
add(short k) |
boolean |
addAll(java.util.Collection<? extends java.lang.Short> c) |
boolean |
addAll(long index,
java.util.Collection<? extends java.lang.Short> c)
Adds all of the elements in the specified collection to this list (optional operation).
|
boolean |
addAll(long index,
it.unimi.dsi.fastutil.shorts.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(it.unimi.dsi.fastutil.shorts.ShortCollection c) |
void |
addElements(long index,
short[][] a)
Add (hopefully quickly) elements to this type-specific big list.
|
void |
addElements(long index,
short[][] a,
long offset,
long length)
Add (hopefully quickly) elements to this type-specific big list.
|
void |
clear() |
int |
compareTo(it.unimi.dsi.fastutil.BigList<? extends java.lang.Short> l)
Compares this big list to another object.
|
boolean |
contains(short k)
Returns true if this list contains the specified element.
|
protected void |
ensureIndex(long index)
Ensures that the given index is nonnegative and not greater than this big-list size.
|
protected void |
ensureRestrictedIndex(long index)
Ensures that the given index is nonnegative and smaller than this big-list size.
|
boolean |
equals(java.lang.Object o) |
void |
forEach(it.unimi.dsi.fastutil.shorts.ShortConsumer action) |
java.lang.Short |
get(long index)
Deprecated.
Please use the corresponding type-specific method instead.
|
void |
getElements(long from,
short[][] a,
long offset,
long length)
Copies (hopefully quickly) elements of this type-specific big list into the given big array.
|
int |
hashCode()
Returns the hash code for this big list, which is identical to
List.hashCode(). |
long |
indexOf(java.lang.Object ok)
Deprecated.
Please use the corresponding type-specific method instead.
|
long |
indexOf(short k)
Returns the index of the first occurrence of the specified element in this type-specific big list, or -1 if this big list does not contain the element.
|
it.unimi.dsi.fastutil.ints.IntSpliterator |
intSpliterator() |
it.unimi.dsi.fastutil.shorts.ShortBigListIterator |
iterator()
Returns a type-specific iterator on the elements of this list.
|
long |
lastIndexOf(java.lang.Object ok)
Deprecated.
Please use the corresponding type-specific method instead.
|
long |
lastIndexOf(short k)
Returns the index of the last occurrence of the specified element in this type-specific big list, or -1 if this big list does not contain the element.
|
it.unimi.dsi.fastutil.shorts.ShortBigListIterator |
listIterator()
Returns a type-specific big-list iterator on this type-specific big list.
|
it.unimi.dsi.fastutil.shorts.ShortBigListIterator |
listIterator(long index)
Returns a type-specific list iterator on this type-specific big list starting at a given index.
|
java.lang.Short |
peek(int i)
Deprecated.
Please use the corresponding type-specific method instead.
|
short |
peekShort(int i) |
java.lang.Short |
pop()
Deprecated.
Please use the corresponding type-specific method instead.
|
short |
popShort() |
void |
push(short o) |
void |
push(java.lang.Short o)
Deprecated.
Please use the corresponding type-specific method instead.
|
boolean |
rem(short k)
Removes a single instance of the specified element from this collection, if it is present (optional operation).
|
java.lang.Short |
remove(long index)
Deprecated.
Please use the corresponding type-specific method instead.
|
void |
removeElements(long from,
long to)
Removes (hopefully quickly) elements of this type-specific big list.
|
short |
removeShort(long i)
Removes the element at the specified position.
|
short |
set(long index,
short k)
Replaces the element at the specified position in this big list with the specified element (optional operation).
|
java.lang.Short |
set(long index,
java.lang.Short ok)
Deprecated.
Please use the corresponding type-specific method instead.
|
void |
setElements(long index,
short[][] a,
long offset,
long length)
Set (hopefully quickly) elements to match the array given.
|
int |
size()
Deprecated.
Please use
Size64.size64() instead. |
void |
size(long size) |
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. |
java.lang.Short |
top()
Deprecated.
Please use the corresponding type-specific method instead.
|
short |
topShort() |
java.lang.String |
toString() |
add, contains, containsAll, containsAll, remove, removeAll, removeAll, retainAll, retainAll, toArray, toShortArray, toShortArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddAll, addAll, addAll, addAll, getElements, getShort, setElements, setElements, spliteratoradd, contains, containsAll, intIterator, intParallelStream, intStream, parallelStream, remove, removeAll, removeIf, removeIf, removeIf, retainAll, stream, toArray, toShortArray, toShortArrayprotected void ensureIndex(long index)
index - an index.java.lang.IndexOutOfBoundsException - if the given index is negative or greater than this big-list size.protected void ensureRestrictedIndex(long index)
index - an index.java.lang.IndexOutOfBoundsException - if the given index is negative or not smaller than this big-list size.public void add(long index,
short k)
add in interface ShortBigListBigList.add(long,Object)public boolean add(short k)
add in interface it.unimi.dsi.fastutil.shorts.ShortCollectionadd in class it.unimi.dsi.fastutil.shorts.AbstractShortCollectionpublic short removeShort(long i)
removeShort in interface ShortBigListBigList.remove(long)public short set(long index,
short k)
set in interface ShortBigListBigList.set(long,Object)public boolean addAll(long index,
java.util.Collection<? extends java.lang.Short> c)
addAll in interface it.unimi.dsi.fastutil.BigList<java.lang.Short>public boolean addAll(java.util.Collection<? extends java.lang.Short> c)
addAll in interface java.util.Collection<java.lang.Short>addAll in class it.unimi.dsi.fastutil.shorts.AbstractShortCollectionpublic it.unimi.dsi.fastutil.shorts.ShortBigListIterator iterator()
iterator in interface ShortBigListiterator in interface it.unimi.dsi.fastutil.shorts.ShortCollectioniterator in interface it.unimi.dsi.fastutil.shorts.ShortIterableiterator in interface java.lang.Iterable<java.lang.Short>iterator in interface java.util.Collection<java.lang.Short>iterator in class it.unimi.dsi.fastutil.shorts.AbstractShortCollectionCollection.iterator()public it.unimi.dsi.fastutil.shorts.ShortBigListIterator listIterator()
listIterator in interface it.unimi.dsi.fastutil.BigList<java.lang.Short>listIterator in interface ShortBigListBigList.listIterator()public it.unimi.dsi.fastutil.shorts.ShortBigListIterator listIterator(long index)
listIterator in interface it.unimi.dsi.fastutil.BigList<java.lang.Short>listIterator in interface ShortBigListBigList.listIterator(long)public it.unimi.dsi.fastutil.ints.IntSpliterator intSpliterator()
intSpliterator in interface it.unimi.dsi.fastutil.shorts.ShortCollectionintSpliterator in interface it.unimi.dsi.fastutil.shorts.ShortIterablepublic boolean contains(short k)
contains in interface it.unimi.dsi.fastutil.shorts.ShortCollectioncontains in class it.unimi.dsi.fastutil.shorts.AbstractShortCollectionCollection.contains(Object)public long indexOf(short k)
ShortBigListindexOf in interface ShortBigListBigList.indexOf(Object)public long lastIndexOf(short k)
ShortBigListlastIndexOf in interface ShortBigListBigList.lastIndexOf(Object)public void size(long size)
size in interface it.unimi.dsi.fastutil.BigList<java.lang.Short>public ShortBigList subList(long from, long to)
ShortBigListfrom, inclusive, to the index to, exclusive.subList in interface it.unimi.dsi.fastutil.BigList<java.lang.Short>subList in interface ShortBigListBigList.subList(long,long)public void forEach(it.unimi.dsi.fastutil.shorts.ShortConsumer action)
forEach in interface it.unimi.dsi.fastutil.shorts.ShortIterablepublic void removeElements(long from,
long to)
This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
removeElements in interface ShortBigListfrom - the start index (inclusive).to - the end index (exclusive).public void addElements(long index,
short[][] a,
long offset,
long length)
This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
addElements in interface ShortBigListindex - the index at which to add elements.a - the big array containing the elements.offset - the offset of the first element to add.length - the number of elements to add.public void addElements(long index,
short[][] a)
addElements in interface ShortBigListindex - the index at which to add elements.a - the big array containing the elements.public void getElements(long from,
short[][] a,
long offset,
long length)
This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
getElements in interface ShortBigListfrom - the start index (inclusive).a - the destination big array.offset - the offset into the destination big array where to store the first element copied.length - the number of elements to be copied.public void setElements(long index,
short[][] a,
long offset,
long length)
ShortBigList
ListIterator iter = listIterator(index);
long i = 0;
while (i < length) {
iter.next();
iter.set(BigArrays.get(a, offset + i++);
}
However, the exact implementation may be more efficient, taking into account
whether random access is faster or not, or at the discretion of subclasses,
abuse internals.setElements in interface ShortBigListindex - the index at which to start setting elements.a - the big array containing the elements.offset - the offset of the first element to add.length - the number of elements to add.public void clear()
clear in interface java.util.Collection<java.lang.Short>clear in class java.util.AbstractCollection<java.lang.Short>@Deprecated public int size()
Size64.size64() instead.size in interface it.unimi.dsi.fastutil.BigList<java.lang.Short>size in interface it.unimi.dsi.fastutil.Size64size in interface java.util.Collection<java.lang.Short>size in class java.util.AbstractCollection<java.lang.Short>public int hashCode()
List.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.Objectpublic int compareTo(it.unimi.dsi.fastutil.BigList<? extends java.lang.Short> l)
BigList, this method performs a lexicographical comparison; otherwise,
it throws a ClassCastException.compareTo in interface java.lang.Comparable<it.unimi.dsi.fastutil.BigList<? extends java.lang.Short>>l - a big list.BigList, a negative integer,
zero, or a positive integer as this list is lexicographically less than, equal
to, or greater than the argument.java.lang.ClassCastException - if the argument is not a big list.public void push(short o)
push in interface it.unimi.dsi.fastutil.shorts.ShortStackpublic short popShort()
popShort in interface it.unimi.dsi.fastutil.shorts.ShortStackpublic short topShort()
topShort in interface it.unimi.dsi.fastutil.shorts.ShortStackpublic short peekShort(int i)
peekShort in interface it.unimi.dsi.fastutil.shorts.ShortStackpublic boolean rem(short k)
rem in interface it.unimi.dsi.fastutil.shorts.ShortCollectionrem in class it.unimi.dsi.fastutil.shorts.AbstractShortCollectionCollection.remove(Object)public boolean addAll(long index,
it.unimi.dsi.fastutil.shorts.ShortCollection c)
addAll in interface ShortBigListList.addAll(int,java.util.Collection)public boolean addAll(it.unimi.dsi.fastutil.shorts.ShortCollection c)
addAll in interface it.unimi.dsi.fastutil.shorts.ShortCollectionaddAll in class it.unimi.dsi.fastutil.shorts.AbstractShortCollection@Deprecated
public void add(long index,
java.lang.Short ok)
add in interface it.unimi.dsi.fastutil.BigList<java.lang.Short>add in interface ShortBigList@Deprecated
public java.lang.Short set(long index,
java.lang.Short ok)
set in interface it.unimi.dsi.fastutil.BigList<java.lang.Short>set in interface ShortBigList@Deprecated public java.lang.Short get(long index)
get in interface it.unimi.dsi.fastutil.BigList<java.lang.Short>get in interface ShortBigList@Deprecated public long indexOf(java.lang.Object ok)
indexOf in interface it.unimi.dsi.fastutil.BigList<java.lang.Short>indexOf in interface ShortBigList@Deprecated public long lastIndexOf(java.lang.Object ok)
lastIndexOf in interface it.unimi.dsi.fastutil.BigList<java.lang.Short>lastIndexOf in interface ShortBigList@Deprecated public java.lang.Short remove(long index)
remove in interface it.unimi.dsi.fastutil.BigList<java.lang.Short>remove in interface ShortBigList@Deprecated public void push(java.lang.Short o)
push in interface it.unimi.dsi.fastutil.shorts.ShortStackpush in interface it.unimi.dsi.fastutil.Stack<java.lang.Short>@Deprecated public java.lang.Short pop()
pop in interface it.unimi.dsi.fastutil.shorts.ShortStackpop in interface it.unimi.dsi.fastutil.Stack<java.lang.Short>@Deprecated public java.lang.Short top()
top in interface it.unimi.dsi.fastutil.shorts.ShortStacktop in interface it.unimi.dsi.fastutil.Stack<java.lang.Short>@Deprecated public java.lang.Short peek(int i)
peek in interface it.unimi.dsi.fastutil.shorts.ShortStackpeek in interface it.unimi.dsi.fastutil.Stack<java.lang.Short>public java.lang.String toString()
toString in class it.unimi.dsi.fastutil.shorts.AbstractShortCollection