public static class AbstractIntList.IntSubList extends AbstractIntList implements java.io.Serializable
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) |
void |
add(int index,
int k) |
boolean |
addAll(int index,
java.util.Collection<? extends java.lang.Integer> c) |
boolean |
addAll(int index,
IntCollection c)
Delegates to a more generic method.
|
boolean |
addAll(int index,
IntList l)
Delegates to a more generic method.
|
void |
addElements(int index,
int[] a,
int offset,
int length)
Adds elements to this type-specific list one-by-one.
|
void |
clear() |
void |
getElements(int from,
int[] a,
int offset,
int length)
Copies element of this type-specific list into the given array
one-by-one.
|
int |
getInt(int index) |
IntListIterator |
listIterator(int index)
Returns a type-specific list iterator on the list starting at a given
index.
|
boolean |
rem(int k)
Note that this method should be called
remove(), but the clash with
the similarly named index-based method in the List
interface forces us to use a distinguished name. |
boolean |
remove(java.lang.Object o)
Delegates to
rem(). |
void |
removeElements(int from,
int to)
Removes elements of this type-specific list one-by-one.
|
int |
removeInt(int index) |
int |
set(int index,
int k) |
int |
size() |
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. |
add, addAll, addAll, addAll, addElements, compareTo, contains, ensureIndex, ensureRestrictedIndex, equals, get, hashCode, indexOf, indexOf, intListIterator, intListIterator, intSubList, iterator, lastIndexOf, lastIndexOf, listIterator, peek, peekInt, pop, popInt, push, push, remove, set, size, top, topInt, toStringadd, contains, containsAll, containsAll, intIterator, isEmpty, rem, removeAll, removeAll, retainAll, retainAll, toArray, toArray, toArray, toIntArray, toIntArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, contains, containsAll, isEmpty, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArraycontainsAll, intIterator, removeAll, retainAll, toArray, toArray, toIntArray, toIntArrayprotected final IntList l
protected final int from
protected int to
public IntSubList(IntList l, int from, int to)
public boolean add(int k)
add in interface IntCollectionadd in interface IntListadd in class AbstractIntListCollection.add(Object)public void add(int index,
int k)
add in interface IntListadd in class AbstractIntListList.add(int,Object)public boolean addAll(int index,
java.util.Collection<? extends java.lang.Integer> c)
addAll in interface java.util.List<java.lang.Integer>addAll in class AbstractIntListpublic int getInt(int index)
public int removeInt(int index)
removeInt in interface IntListremoveInt in class AbstractIntListList.remove(int)public int set(int index,
int k)
set in interface IntListset in class AbstractIntListList.set(int,Object)public void clear()
clear in interface java.util.Collection<java.lang.Integer>clear in interface java.util.List<java.lang.Integer>clear in class java.util.AbstractCollection<java.lang.Integer>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 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 IntListIterator listIterator(int index)
IntListlistIterator in interface IntListlistIterator in interface java.util.List<java.lang.Integer>listIterator in class AbstractIntListList.listIterator(int)public IntList subList(int from, int to)
IntListfrom, inclusive, to the index to, exclusive.
Note that this specification strengthens the one given in
List.subList(int,int).
subList in interface IntListsubList in interface java.util.List<java.lang.Integer>subList in class AbstractIntListList.subList(int,int)public boolean rem(int k)
IntCollectionremove(), but the clash with
the similarly named index-based method in the List
interface forces us to use a distinguished name. For simplicity, the set
interfaces reinstates remove().rem in interface IntCollectionrem in class AbstractIntListCollection.remove(Object)public boolean remove(java.lang.Object o)
AbstractIntListrem().remove in interface java.util.Collection<java.lang.Integer>remove in interface java.util.List<java.lang.Integer>remove in class AbstractIntListpublic boolean addAll(int index,
IntCollection c)
AbstractIntListaddAll in interface IntListaddAll in class AbstractIntListList.add(int,Object)public boolean addAll(int index,
IntList l)
AbstractIntListaddAll in interface IntListaddAll in class AbstractIntListList.add(int,Object)