public static class AbstractDoubleList.DoubleSubList extends AbstractDoubleList implements Serializable
AbstractDoubleList.DoubleSubList| Modifier and Type | Field and Description |
|---|---|
protected int |
from
Initial (inclusive) index of this sublist.
|
protected DoubleList |
l
The list this sublist restricts.
|
protected int |
to
Final (exclusive) index of this sublist.
|
| Constructor and Description |
|---|
DoubleSubList(DoubleList l,
int from,
int to) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(double k)
Ensures that this collection contains the specified element (optional operation).
|
void |
add(int index,
double k)
Inserts the specified element at the specified position in this list (optional operation).
|
boolean |
addAll(int index,
Collection<? extends Double> c)
Adds all of the elements in the specified collection to this list (optional operation).
|
boolean |
addAll(int index,
DoubleCollection 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,
DoubleList 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,
double[] a,
int offset,
int length)
Add (hopefully quickly) elements to this type-specific list.
|
double |
getDouble(int index)
Returns the element at the specified position in this list.
|
void |
getElements(int from,
double[] a,
int offset,
int length)
Copies (hopefully quickly) elements of this type-specific list into the given array.
|
DoubleListIterator |
listIterator(int index)
Returns a type-specific list iterator on the list starting at a given index.
|
boolean |
rem(double k)
Removes a single instance of the specified element from this collection, if it is present (optional operation).
|
double |
removeDouble(int index)
Removes the element at the specified position in this list (optional operation).
|
void |
removeElements(int from,
int to)
Removes (hopefully quickly) elements of this type-specific list.
|
double |
set(int index,
double k)
Replaces the element at the specified position in this list with the specified element (optional operation).
|
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. |
addAll, addAll, addAll, addElements, clear, compareTo, contains, ensureIndex, ensureRestrictedIndex, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, peekDouble, popDouble, push, size, topDouble, toStringadd, contains, containsAll, remove, removeAll, retainAll, toArray, toDoubleArray, toDoubleArraycontainsAll, isEmpty, removeAll, retainAll, toArray, toArrayclone, finalize, getClass, notify, notifyAll, wait, wait, waitadd, add, contains, get, indexOf, lastIndexOf, remove, remove, set, setElements, setElements, setElements, sort, sort, unstableSort, unstableSortcontainsAll, isEmpty, removeAll, replaceAll, retainAll, spliterator, toArray, toArraycontainsAll, removeAll, removeIf, removeIf, retainAll, toArray, toDoubleArray, toDoubleArrayparallelStream, streamforEach, forEachpeek, pop, push, topprotected final DoubleList l
protected final int from
protected int to
public DoubleSubList(DoubleList l, int from, int to)
public boolean add(double k)
AbstractDoubleListThis implementation always throws an UnsupportedOperationException.
This implementation delegates to the type-specific version of List.add(int, Object).
add in interface DoubleCollectionadd in interface DoubleListadd in class AbstractDoubleListCollection.add(Object)public void add(int index,
double k)
AbstractDoubleListThis implementation always throws an UnsupportedOperationException.
add in interface DoubleListadd in class AbstractDoubleListList.add(int,Object)public boolean addAll(int index,
Collection<? extends Double> c)
AbstractDoubleListaddAll in interface List<Double>addAll in class AbstractDoubleListpublic double getDouble(int index)
DoubleListgetDouble in interface DoubleListList.get(int)public double removeDouble(int index)
AbstractDoubleListThis implementation always throws an UnsupportedOperationException.
removeDouble in interface DoubleListremoveDouble in class AbstractDoubleListList.remove(int)public double set(int index,
double k)
AbstractDoubleListThis implementation always throws an UnsupportedOperationException.
set in interface DoubleListset in class AbstractDoubleListList.set(int,Object)public int size()
size in interface Collection<Double>size in interface List<Double>size in class AbstractCollection<Double>public void getElements(int from,
double[] a,
int offset,
int length)
AbstractDoubleListThis is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
getElements in interface DoubleListgetElements in class AbstractDoubleListfrom - 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)
AbstractDoubleListThis is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
removeElements in interface DoubleListremoveElements in class AbstractDoubleListfrom - the start index (inclusive).to - the end index (exclusive).public void addElements(int index,
double[] a,
int offset,
int length)
AbstractDoubleListThis is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
addElements in interface DoubleListaddElements in class AbstractDoubleListindex - 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)
AbstractDoubleListThis implementation is based on the random-access methods.
listIterator in interface DoubleListlistIterator in interface List<Double>listIterator in class AbstractDoubleListList.listIterator(int)public DoubleList subList(int from, int to)
DoubleListfrom, inclusive, to the index to, exclusive.
Note that this specification strengthens the one given in List.subList(int,int).
subList in interface DoubleListsubList in interface List<Double>subList in class AbstractDoubleListList.subList(int,int)public boolean rem(double k)
AbstractDoubleListThis implementation delegates to indexOf().
rem in interface DoubleCollectionrem in class AbstractDoubleListList.remove(Object)public boolean addAll(int index,
DoubleCollection c)
DoubleListaddAll in interface DoubleListaddAll in class AbstractDoubleListList.addAll(int,java.util.Collection)public boolean addAll(int index,
DoubleList l)
AbstractDoubleListThis implementation delegates to the type-specific version of List.addAll(int, Collection).
addAll in interface DoubleListaddAll in class AbstractDoubleListList.add(int,Object)Copyright © 2020. All rights reserved.