public static class AbstractIntList.IntSubList extends AbstractIntList implements Serializable
AbstractIntList.IntSubList
Constructor and Description |
---|
AbstractIntList.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,
Collection<? extends 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)
|
boolean |
remove(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, equals, get, hashCode, indexOf, indexOf, intListIterator, intListIterator, intSubList, iterator, lastIndexOf, lastIndexOf, listIterator, peek, peekInt, pop, popInt, push, push, remove, set, size, top, topInt, toString
add, contains, containsAll, containsAll, intIterator, isEmpty, rem, removeAll, removeAll, retainAll, retainAll, toArray, toArray, toArray, toIntArray, toIntArray
add, contains, containsAll, isEmpty, removeAll, retainAll, toArray, toArray
containsAll, intIterator, removeAll, retainAll, toArray, toArray, toIntArray, toIntArray
public AbstractIntList.IntSubList(IntList l, int from, int to)
public boolean add(int k)
add
in interface IntCollection
add
in interface IntList
add
in class AbstractIntList
Collection.add(Object)
public void add(int index, int k)
add
in interface IntList
add
in class AbstractIntList
List.add(int,Object)
public boolean addAll(int index, Collection<? extends Integer> c)
addAll
in interface List<Integer>
addAll
in class AbstractIntList
public int getInt(int index)
getInt
in interface IntList
List.get(int)
public int removeInt(int index)
removeInt
in interface IntList
removeInt
in class AbstractIntList
List.remove(int)
public int set(int index, int k)
set
in interface IntList
set
in class AbstractIntList
List.set(int,Object)
public void clear()
clear
in interface Collection<Integer>
clear
in interface List<Integer>
clear
in class AbstractCollection<Integer>
public int size()
size
in interface Collection<Integer>
size
in interface List<Integer>
size
in class AbstractCollection<Integer>
public void getElements(int from, int[] a, int offset, int length)
AbstractIntList
This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
getElements
in interface IntList
getElements
in class AbstractIntList
from
- 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)
AbstractIntList
This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
removeElements
in interface IntList
removeElements
in class AbstractIntList
from
- the start index (inclusive).to
- the end index (exclusive).public void addElements(int index, int[] a, int offset, int length)
AbstractIntList
This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
addElements
in interface IntList
addElements
in class AbstractIntList
index
- 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)
IntList
listIterator
in interface IntList
listIterator
in interface List<Integer>
listIterator
in class AbstractIntList
List.listIterator(int)
public IntList subList(int from, int to)
IntList
from
, inclusive, to the index to
, exclusive.
Note that this specification strengthens the one given in List.subList(int,int)
.
subList
in interface IntList
subList
in interface List<Integer>
subList
in class AbstractIntList
List.subList(int,int)
public boolean rem(int k)
IntCollection
remove()
, 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 IntCollection
rem
in class AbstractIntList
Collection.remove(Object)
public boolean remove(Object o)
AbstractIntList
rem()
.remove
in interface Collection<Integer>
remove
in interface List<Integer>
remove
in class AbstractIntList
public boolean addAll(int index, IntCollection c)
AbstractIntList
addAll
in interface IntList
addAll
in class AbstractIntList
List.add(int,Object)
public boolean addAll(int index, IntList l)
AbstractIntList
addAll
in interface IntList
addAll
in class AbstractIntList
List.add(int,Object)