public abstract class AbstractDoubleList extends AbstractDoubleCollection implements DoubleList, DoubleStack
As an additional bonus, this class implements on top of the list operations a type-specific stack.
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractDoubleList.DoubleSubList |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(double k) |
void |
add(int index,
double k) |
void |
add(int index,
java.lang.Double ok)
Delegates to the corresponding type-specific method.
|
boolean |
addAll(java.util.Collection<? extends java.lang.Double> c)
Delegates to a more generic method.
|
boolean |
addAll(DoubleCollection c)
Adds all elements of the given type-specific collection to this collection.
|
boolean |
addAll(DoubleList l) |
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)
Add (hopefully quickly) elements to this type-specific list.
|
void |
addElements(int index,
double[] a,
int offset,
int length)
Adds elements to this type-specific list one-by-one.
|
int |
compareTo(java.util.List<? extends java.lang.Double> l)
Compares this list to another object.
|
boolean |
contains(double k) |
DoubleListIterator |
doubleListIterator()
Deprecated.
|
DoubleListIterator |
doubleListIterator(int index)
Deprecated.
|
DoubleList |
doubleSubList(int from,
int to)
Deprecated.
|
boolean |
equals(java.lang.Object o) |
java.lang.Double |
get(int index)
Deprecated.
Please use the corresponding type-specific method instead.
|
void |
getElements(int from,
double[] a,
int offset,
int length)
Copies element of this type-specific list into the given array one-by-one.
|
int |
hashCode()
Returns the hash code for this list, which is identical to
List.hashCode(). |
int |
indexOf(double k) |
int |
indexOf(java.lang.Object ok)
Delegates to the corresponding type-specific method.
|
DoubleListIterator |
iterator()
Returns a type-specific iterator on the elements of this collection.
|
int |
lastIndexOf(double k) |
int |
lastIndexOf(java.lang.Object ok)
Delegates to the corresponding type-specific method.
|
DoubleListIterator |
listIterator()
Returns a type-specific list iterator on the list.
|
DoubleListIterator |
listIterator(int index)
Returns a type-specific list iterator on the list starting at a given index.
|
java.lang.Double |
peek(int i)
Deprecated.
Please use the corresponding type-specific method instead.
|
double |
peekDouble(int i) |
java.lang.Double |
pop()
Deprecated.
Please use the corresponding type-specific method instead.
|
double |
popDouble() |
void |
push(double o) |
void |
push(java.lang.Double o)
Delegates to the corresponding type-specific method.
|
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. |
java.lang.Double |
remove(int index)
Deprecated.
Please use the corresponding type-specific method instead.
|
boolean |
remove(java.lang.Object o)
Delegates to
rem(). |
double |
removeDouble(int i) |
void |
removeElements(int from,
int to)
Removes elements of this type-specific list one-by-one.
|
double |
set(int index,
double k) |
java.lang.Double |
set(int index,
java.lang.Double ok)
Deprecated.
Please use the corresponding type-specific method instead.
|
void |
size(int size)
Sets the size of this list.
|
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. |
java.lang.Double |
top()
Deprecated.
Please use the corresponding type-specific method instead.
|
double |
topDouble() |
java.lang.String |
toString() |
add, contains, containsAll, containsAll, doubleIterator, isEmpty, rem, removeAll, removeAll, retainAll, retainAll, toArray, toArray, toArray, toDoubleArray, toDoubleArraygetDoubleadd, clear, contains, containsAll, isEmpty, removeAll, replaceAll, retainAll, size, sort, spliterator, toArray, toArraycontainsAll, doubleIterator, removeAll, retainAll, toArray, toArray, toDoubleArray, toDoubleArraypublic void add(int index,
double k)
add in interface DoubleListList.add(int,Object)public boolean add(double k)
add in interface DoubleCollectionadd in interface DoubleListadd in class AbstractDoubleCollectionCollection.add(Object)public double removeDouble(int i)
removeDouble in interface DoubleListList.remove(int)public double set(int index,
double k)
set in interface DoubleListList.set(int,Object)public boolean addAll(int index,
java.util.Collection<? extends java.lang.Double> c)
addAll in interface java.util.List<java.lang.Double>public boolean addAll(java.util.Collection<? extends java.lang.Double> c)
addAll in interface java.util.Collection<java.lang.Double>addAll in interface java.util.List<java.lang.Double>addAll in class AbstractDoubleCollectionc - a collection.true if this collection changed as a result of the call.@Deprecated public DoubleListIterator doubleListIterator()
doubleListIterator in interface DoubleListDoubleList.listIterator()@Deprecated public DoubleListIterator doubleListIterator(int index)
doubleListIterator in interface DoubleListDoubleList.listIterator(int)public DoubleListIterator iterator()
DoubleCollectionNote that this specification strengthens the one given in
Iterable.iterator(), which was already
strengthened in the corresponding type-specific class,
but was weakened by the fact that this interface extends Collection.
iterator in interface DoubleCollectioniterator in interface DoubleIterableiterator in interface DoubleListiterator in interface java.lang.Iterable<java.lang.Double>iterator in interface java.util.Collection<java.lang.Double>iterator in interface java.util.List<java.lang.Double>iterator in class AbstractDoubleCollectionpublic DoubleListIterator listIterator()
DoubleListlistIterator in interface DoubleListlistIterator in interface java.util.List<java.lang.Double>List.listIterator()public DoubleListIterator listIterator(int index)
DoubleListlistIterator in interface DoubleListlistIterator in interface java.util.List<java.lang.Double>List.listIterator(int)public boolean contains(double k)
contains in interface DoubleCollectioncontains in class AbstractDoubleCollectionCollection.contains(Object)public int indexOf(double k)
indexOf in interface DoubleListList.indexOf(Object)public int lastIndexOf(double k)
lastIndexOf in interface DoubleListList.lastIndexOf(Object)public void size(int size)
DoubleListIf the specified size is smaller than the current size, the last elements are
discarded. Otherwise, they are filled with 0/null/false.
size in interface DoubleListsize - the new size.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 java.util.List<java.lang.Double>List.subList(int,int)@Deprecated public DoubleList doubleSubList(int from, int to)
doubleSubList in interface DoubleListList.subList(int,int)public void removeElements(int from,
int to)
This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
removeElements in interface DoubleListfrom - the start index (inclusive).to - the end index (exclusive).public void addElements(int index,
double[] a,
int offset,
int length)
This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
addElements in interface DoubleListindex - 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 addElements(int index,
double[] a)
DoubleListaddElements in interface DoubleListindex - the index at which to add elements.a - the array containing the elements.public void getElements(int from,
double[] a,
int offset,
int length)
This is a trivial iterator-based implementation. It is expected that implementations will override this method with a more optimized version.
getElements in interface DoubleListfrom - 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 boolean equals(java.lang.Object o)
equals in interface java.util.Collection<java.lang.Double>equals in interface java.util.List<java.lang.Double>equals in class java.lang.Objectpublic int compareTo(java.util.List<? extends java.lang.Double> l)
List, this method performs a lexicographical comparison; otherwise,
it throws a ClassCastException.compareTo in interface java.lang.Comparable<java.util.List<? extends java.lang.Double>>l - a list.List, a negative integer,
zero, or a positive integer as this list is lexicographically less than, equal
to, or greater than the argument.java.lang.ClassCastException - if the argument is not a list.public int hashCode()
List.hashCode().hashCode in interface java.util.Collection<java.lang.Double>hashCode in interface java.util.List<java.lang.Double>hashCode in class java.lang.Objectpublic void push(double o)
push in interface DoubleStackStack.push(Object)public double popDouble()
popDouble in interface DoubleStackStack.pop()public double topDouble()
topDouble in interface DoubleStackStack.top()public double peekDouble(int i)
peekDouble in interface DoubleStackStack.peek(int)public boolean rem(double k)
DoubleCollectionremove(), 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 DoubleCollectionrem in class AbstractDoubleCollectionCollection.remove(Object)public boolean remove(java.lang.Object o)
rem().remove in interface java.util.Collection<java.lang.Double>remove in interface java.util.List<java.lang.Double>remove in class AbstractDoubleCollectionpublic boolean addAll(int index,
DoubleCollection c)
addAll in interface DoubleListList.add(int,Object)public boolean addAll(int index,
DoubleList l)
addAll in interface DoubleListList.add(int,Object)public boolean addAll(DoubleCollection c)
AbstractDoubleCollectionaddAll in interface DoubleCollectionaddAll in class AbstractDoubleCollectionc - a type-specific collection.true if this collection changed as a result of the call.Collection.addAll(Collection)public boolean addAll(DoubleList l)
addAll in interface DoubleListList.add(int,Object)public void add(int index,
java.lang.Double ok)
add in interface java.util.List<java.lang.Double>@Deprecated
public java.lang.Double set(int index,
java.lang.Double ok)
set in interface java.util.List<java.lang.Double>@Deprecated public java.lang.Double get(int index)
get in interface java.util.List<java.lang.Double>public int indexOf(java.lang.Object ok)
indexOf in interface java.util.List<java.lang.Double>public int lastIndexOf(java.lang.Object ok)
lastIndexOf in interface java.util.List<java.lang.Double>@Deprecated public java.lang.Double remove(int index)
remove in interface java.util.List<java.lang.Double>public void push(java.lang.Double o)
@Deprecated public java.lang.Double pop()
@Deprecated public java.lang.Double top()
@Deprecated public java.lang.Double peek(int i)
public java.lang.String toString()
toString in class AbstractDoubleCollection