public static class AbstractDoubleList.DoubleSubList extends AbstractDoubleList implements java.io.Serializable
AbstractDoubleList.DoubleSubList
Constructor and Description |
---|
DoubleSubList(DoubleList l,
int from,
int to) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(double k) |
void |
add(int index,
double k) |
boolean |
addAll(int index,
java.util.Collection<? extends java.lang.Double> c) |
boolean |
addAll(int index,
DoubleCollection c)
Delegates to a more generic method.
|
boolean |
addAll(int index,
DoubleList l)
Delegates to a more generic method.
|
void |
addElements(int index,
double[] a,
int offset,
int length)
Adds elements to this type-specific list one-by-one.
|
void |
clear() |
double |
getDouble(int index) |
void |
getElements(int from,
double[] a,
int offset,
int length)
Copies element of this type-specific list into the given array one-by-one.
|
DoubleListIterator |
listIterator(int index)
Returns a type-specific list iterator on the list starting at a given index.
|
boolean |
rem(double 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() . |
double |
removeDouble(int index) |
void |
removeElements(int from,
int to)
Removes elements of this type-specific list one-by-one.
|
double |
set(int index,
double k) |
int |
size() |
DoubleList |
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, doubleListIterator, doubleListIterator, doubleSubList, equals, get, hashCode, indexOf, indexOf, iterator, lastIndexOf, lastIndexOf, listIterator, peek, peekDouble, pop, popDouble, push, push, remove, set, size, top, topDouble, toString
add, contains, containsAll, containsAll, doubleIterator, isEmpty, rem, removeAll, removeAll, retainAll, retainAll, toArray, toArray, toArray, toDoubleArray, toDoubleArray
add, contains, containsAll, isEmpty, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
containsAll, doubleIterator, removeAll, retainAll, toArray, toArray, toDoubleArray, toDoubleArray
public DoubleSubList(DoubleList l, int from, int to)
public boolean add(double k)
add
in interface DoubleCollection
add
in interface DoubleList
add
in class AbstractDoubleList
Collection.add(Object)
public void add(int index, double k)
add
in interface DoubleList
add
in class AbstractDoubleList
List.add(int,Object)
public boolean addAll(int index, java.util.Collection<? extends java.lang.Double> c)
addAll
in interface java.util.List<java.lang.Double>
addAll
in class AbstractDoubleList
public double getDouble(int index)
getDouble
in interface DoubleList
List.get(int)
public double removeDouble(int index)
removeDouble
in interface DoubleList
removeDouble
in class AbstractDoubleList
List.remove(int)
public double set(int index, double k)
set
in interface DoubleList
set
in class AbstractDoubleList
List.set(int,Object)
public void clear()
clear
in interface java.util.Collection<java.lang.Double>
clear
in interface java.util.List<java.lang.Double>
clear
in class java.util.AbstractCollection<java.lang.Double>
public int size()
size
in interface java.util.Collection<java.lang.Double>
size
in interface java.util.List<java.lang.Double>
size
in class java.util.AbstractCollection<java.lang.Double>
public void getElements(int from, double[] a, int offset, int length)
AbstractDoubleList
This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
getElements
in interface DoubleList
getElements
in class AbstractDoubleList
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)
AbstractDoubleList
This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
removeElements
in interface DoubleList
removeElements
in class AbstractDoubleList
from
- the start index (inclusive).to
- the end index (exclusive).public void addElements(int index, double[] a, int offset, int length)
AbstractDoubleList
This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
addElements
in interface DoubleList
addElements
in class AbstractDoubleList
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 DoubleListIterator listIterator(int index)
DoubleList
listIterator
in interface DoubleList
listIterator
in interface java.util.List<java.lang.Double>
listIterator
in class AbstractDoubleList
List.listIterator(int)
public DoubleList subList(int from, int to)
DoubleList
from
, inclusive, to the index to
, exclusive.
Note that this specification strengthens the one given in List.subList(int,int)
.
subList
in interface DoubleList
subList
in interface java.util.List<java.lang.Double>
subList
in class AbstractDoubleList
List.subList(int,int)
public boolean rem(double k)
DoubleCollection
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 DoubleCollection
rem
in class AbstractDoubleList
Collection.remove(Object)
public boolean remove(java.lang.Object o)
AbstractDoubleList
rem()
.remove
in interface java.util.Collection<java.lang.Double>
remove
in interface java.util.List<java.lang.Double>
remove
in class AbstractDoubleList
public boolean addAll(int index, DoubleCollection c)
AbstractDoubleList
addAll
in interface DoubleList
addAll
in class AbstractDoubleList
List.add(int,Object)
public boolean addAll(int index, DoubleList l)
AbstractDoubleList
addAll
in interface DoubleList
addAll
in class AbstractDoubleList
List.add(int,Object)