public static class AbstractLongList.LongSubList extends AbstractLongList implements java.io.Serializable
AbstractLongList.LongRandomAccessSubList, AbstractLongList.LongSubList| Modifier and Type | Field and Description |
|---|---|
protected int |
from
Initial (inclusive) index of this sublist.
|
protected LongList |
l
The list this sublist restricts.
|
protected int |
to
Final (exclusive) index of this sublist.
|
| Constructor and Description |
|---|
LongSubList(LongList l,
int from,
int to) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
long k)
Inserts the specified element at the specified position in this list (optional operation).
|
boolean |
add(long k)
Ensures that this collection contains the specified element (optional operation).
|
boolean |
addAll(int index,
java.util.Collection<? extends java.lang.Long> c)
Adds all of the elements in the specified collection to this list (optional operation).
|
boolean |
addAll(int index,
LongCollection 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 index,
LongList l)
Inserts all of the elements in the specified type-specific list into this type-specific list at the specified position (optional operation).
|
void |
addElements(int index,
long[] a,
int offset,
int length)
Add (hopefully quickly) elements to this type-specific list.
|
void |
getElements(int from,
long[] a,
int offset,
int length)
Copies (hopefully quickly) elements of this type-specific list into the given array.
|
long |
getLong(int index)
Returns the element at the specified position in this list.
|
LongListIterator |
listIterator(int index)
Returns a type-specific list iterator on the list starting at a given index.
|
boolean |
rem(long k)
Removes a single instance of the specified element from this collection, if it is present (optional operation).
|
void |
removeElements(int from,
int to)
Removes (hopefully quickly) elements of this type-specific list.
|
long |
removeLong(int index)
Removes the element at the specified position in this list (optional operation).
|
long |
set(int index,
long k)
Replaces the element at the specified position in this list with the specified element (optional operation).
|
void |
setElements(int index,
long[] a,
int offset,
int length)
Set (hopefully quickly) elements to match the array given.
|
int |
size() |
it.unimi.dsi.fastutil.longs.LongSpliterator |
spliterator()
Returns a type-specific spliterator on the elements of this list.
|
LongList |
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. |
addAll, addAll, addElements, clear, compareTo, contains, ensureIndex, ensureRestrictedIndex, equals, forEach, hashCode, indexOf, iterator, lastIndexOf, listIterator, peekLong, popLong, push, replaceAll, size, toArray, toLongArray, topLong, toStringadd, contains, containsAll, containsAll, forEach, remove, removeAll, removeAll, removeIf, retainAll, retainAll, toLongArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, add, addAll, contains, get, indexOf, lastIndexOf, of, of, of, of, of, remove, remove, replaceAll, replaceAll, set, setElements, setElements, sort, sort, unstableSort, unstableSortcontainsAll, isEmpty, removeAll, retainAll, toArray, toArraycontainsAll, longIterator, longParallelStream, longSpliterator, longStream, parallelStream, removeAll, removeIf, removeIf, removeIf, retainAll, stream, toLongArrayforEach, forEachprotected final LongList l
protected final int from
protected int to
public LongSubList(LongList l, int from, int to)
public boolean add(long k)
AbstractLongListadd in interface LongCollectionadd in interface LongListadd in class AbstractLongListCollection.add(Object)public void add(int index,
long k)
AbstractLongListadd in interface LongListadd in class AbstractLongListList.add(int,Object)public boolean addAll(int index,
java.util.Collection<? extends java.lang.Long> c)
AbstractLongListaddAll in interface java.util.List<java.lang.Long>addAll in class AbstractLongListpublic long getLong(int index)
LongListpublic long removeLong(int index)
AbstractLongListremoveLong in interface LongListremoveLong in class AbstractLongListList.remove(int)public long set(int index,
long k)
AbstractLongListset in interface LongListset in class AbstractLongListList.set(int,Object)public int size()
size in interface java.util.Collection<java.lang.Long>size in interface java.util.List<java.lang.Long>size in class java.util.AbstractCollection<java.lang.Long>public void getElements(int from,
long[] a,
int offset,
int length)
AbstractLongListThis is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
getElements in interface LongListgetElements in class AbstractLongListfrom - the start index (inclusive).a - the destination array.offset - the offset into the destination array where to store the first element copied.length - the number of elements to be copied.public void removeElements(int from,
int to)
AbstractLongListThis is a trivial iterator-based based implementation. It is expected that implementations will override this method with a more optimized version.
removeElements in interface LongListremoveElements in class AbstractLongListfrom - the start index (inclusive).to - the end index (exclusive).public void addElements(int index,
long[] a,
int offset,
int length)
AbstractLongListThis is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
addElements in interface LongListaddElements in class AbstractLongListindex - the index at which to add elements.a - the array containing the elements.offset - the offset of the first element to add.length - the number of elements to add.public void setElements(int index,
long[] a,
int offset,
int length)
LongList
ListIterator iter = listIterator(index);
int i = 0;
while (i < length) {
iter.next();
iter.set(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 LongListsetElements in class AbstractLongListindex - the index at which to start setting elements.a - the array containing the elementsoffset - the offset of the first element to add.length - the number of elements to add.public LongListIterator listIterator(int index)
AbstractLongListlistIterator in interface LongListlistIterator in interface java.util.List<java.lang.Long>listIterator in class AbstractLongListList.listIterator(int)public it.unimi.dsi.fastutil.longs.LongSpliterator spliterator()
LongListList spliterators must report at least Spliterator.SIZED and Spliterator.ORDERED.
See List.spliterator() for more documentation on the requirements
of the returned spliterator.
spliterator in interface LongCollectionspliterator in interface LongIterablespliterator in interface LongListspliterator in interface java.lang.Iterable<java.lang.Long>spliterator in interface java.util.Collection<java.lang.Long>spliterator in interface java.util.List<java.lang.Long>public LongList subList(int from, int to)
LongListfrom, inclusive, to the index to, exclusive.subList in interface LongListsubList in interface java.util.List<java.lang.Long>subList in class AbstractLongListList.subList(int,int)public boolean rem(long k)
AbstractLongListrem in interface LongCollectionrem in class AbstractLongListList.remove(Object)public boolean addAll(int index,
LongCollection c)
LongListaddAll in interface LongListaddAll in class AbstractLongListList.addAll(int,java.util.Collection)