public static class AbstractIntList.IntSubList extends AbstractIntList implements java.io.Serializable
AbstractIntList.IntRandomAccessSubList, AbstractIntList.IntSubList| Modifier and Type | Field and Description |
|---|---|
protected int |
from
Initial (inclusive) index of this sublist.
|
protected IntList |
l
The list this sublist restricts.
|
protected int |
to
Final (exclusive) index of this sublist.
|
| Constructor and Description |
|---|
IntSubList(IntList l,
int from,
int to) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(int k)
Ensures that this collection contains the specified element (optional operation).
|
void |
add(int index,
int k)
Inserts the specified element at the specified position in this list (optional operation).
|
boolean |
addAll(int index,
java.util.Collection<? extends java.lang.Integer> c)
Adds all of the elements in the specified collection to this list (optional operation).
|
boolean |
addAll(int index,
IntCollection 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,
IntList 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,
int[] a,
int offset,
int length)
Add (hopefully quickly) elements to this type-specific list.
|
void |
getElements(int from,
int[] a,
int offset,
int length)
Copies (hopefully quickly) elements of this type-specific list into the given array.
|
int |
getInt(int index)
Returns the element at the specified position in this list.
|
IntListIterator |
listIterator(int index)
Returns a type-specific list iterator on the list starting at a given index.
|
boolean |
rem(int 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.
|
int |
removeInt(int index)
Removes the element at the specified position in this list (optional operation).
|
int |
set(int index,
int k)
Replaces the element at the specified position in this list with the specified element (optional operation).
|
void |
setElements(int index,
int[] a,
int offset,
int length)
Set (hopefully quickly) elements to match the array given.
|
int |
size() |
it.unimi.dsi.fastutil.ints.IntSpliterator |
spliterator()
Returns a type-specific spliterator on the elements of this list.
|
IntList |
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, peekInt, popInt, push, replaceAll, size, toArray, toIntArray, topInt, toStringadd, contains, containsAll, containsAll, forEach, remove, removeAll, removeAll, removeIf, retainAll, retainAll, toIntArrayclone, 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, intIterator, intParallelStream, intSpliterator, intStream, parallelStream, removeAll, removeIf, removeIf, removeIf, retainAll, stream, toIntArrayforEach, forEachprotected final IntList l
protected final int from
protected int to
public IntSubList(IntList l, int from, int to)
public boolean add(int k)
AbstractIntListadd in interface IntCollectionadd in interface IntListadd in class AbstractIntListCollection.add(Object)public void add(int index,
int k)
AbstractIntListadd in interface IntListadd in class AbstractIntListList.add(int,Object)public boolean addAll(int index,
java.util.Collection<? extends java.lang.Integer> c)
AbstractIntListaddAll in interface java.util.List<java.lang.Integer>addAll in class AbstractIntListpublic int getInt(int index)
IntListpublic int removeInt(int index)
AbstractIntListremoveInt in interface IntListremoveInt in class AbstractIntListList.remove(int)public int set(int index,
int k)
AbstractIntListset in interface IntListset in class AbstractIntListList.set(int,Object)public int size()
size in interface java.util.Collection<java.lang.Integer>size in interface java.util.List<java.lang.Integer>size in class java.util.AbstractCollection<java.lang.Integer>public void getElements(int from,
int[] a,
int offset,
int length)
AbstractIntListThis is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
getElements in interface IntListgetElements in class AbstractIntListfrom - 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)
AbstractIntListThis is a trivial iterator-based based implementation. It is expected that implementations will override this method with a more optimized version.
removeElements in interface IntListremoveElements in class AbstractIntListfrom - the start index (inclusive).to - the end index (exclusive).public void addElements(int index,
int[] a,
int offset,
int length)
AbstractIntListThis is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
addElements in interface IntListaddElements in class AbstractIntListindex - 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,
int[] a,
int offset,
int length)
IntList
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 IntListsetElements in class AbstractIntListindex - 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 IntListIterator listIterator(int index)
AbstractIntListlistIterator in interface IntListlistIterator in interface java.util.List<java.lang.Integer>listIterator in class AbstractIntListList.listIterator(int)public it.unimi.dsi.fastutil.ints.IntSpliterator spliterator()
IntListList 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 IntCollectionspliterator in interface IntIterablespliterator in interface IntListspliterator in interface java.lang.Iterable<java.lang.Integer>spliterator in interface java.util.Collection<java.lang.Integer>spliterator in interface java.util.List<java.lang.Integer>public IntList subList(int from, int to)
IntListfrom, inclusive, to the index to, exclusive.subList in interface IntListsubList in interface java.util.List<java.lang.Integer>subList in class AbstractIntListList.subList(int,int)public boolean rem(int k)
AbstractIntListrem in interface IntCollectionrem in class AbstractIntListList.remove(Object)public boolean addAll(int index,
IntCollection c)
IntListaddAll in interface IntListaddAll in class AbstractIntListList.addAll(int,java.util.Collection)