|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectit.unimi.dsi.fastutil.doubles.AbstractDoubleCollection
it.unimi.dsi.fastutil.doubles.AbstractDoubleList
public abstract class AbstractDoubleList
An abstract class providing basic methods for lists implementing a type-specific list interface.
As an additional bonus, this class implements on top of the list operations a type-specific stack.
| Nested Class Summary | |
|---|---|
static class |
AbstractDoubleList.DoubleSubList
|
| Method Summary | |
|---|---|
boolean |
add(double k)
|
void |
add(int index,
double k)
|
void |
add(int index,
Double ok)
Delegates to the corresponding type-specific method. |
boolean |
addAll(Collection<? extends 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,
Collection<? extends 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(List<? extends 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(Object o)
|
Double |
get(int index)
Delegates to the corresponding type-specific method. |
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(Object ok)
Delegates to the corresponding type-specific method. |
DoubleIterator |
iterator()
Returns a type-specific iterator on the elements of this collection. |
int |
lastIndexOf(double k)
|
int |
lastIndexOf(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. |
Double |
peek(int i)
Delegates to the corresponding type-specific method. |
double |
peekDouble(int i)
|
Double |
pop()
Delegates to the corresponding type-specific method. |
double |
popDouble()
|
void |
push(double o)
|
void |
push(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. |
Double |
remove(int index)
Delegates to the corresponding type-specific method. |
boolean |
remove(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)
|
Double |
set(int index,
Double ok)
Delegates to the corresponding type-specific method. |
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. |
Double |
top()
Delegates to the corresponding type-specific method. |
double |
topDouble()
|
String |
toString()
|
| Methods inherited from class it.unimi.dsi.fastutil.doubles.AbstractDoubleCollection |
|---|
add, clear, contains, containsAll, containsAll, doubleIterator, isEmpty, rem, removeAll, removeAll, retainAll, retainAll, toArray, toArray, toArray, toDoubleArray, toDoubleArray |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface it.unimi.dsi.fastutil.doubles.DoubleList |
|---|
getDouble |
| Methods inherited from interface java.util.List |
|---|
add, clear, contains, containsAll, isEmpty, removeAll, retainAll, size, toArray, toArray |
| Methods inherited from interface it.unimi.dsi.fastutil.doubles.DoubleCollection |
|---|
containsAll, doubleIterator, removeAll, retainAll, toArray, toArray, toDoubleArray, toDoubleArray |
| Methods inherited from interface it.unimi.dsi.fastutil.Stack |
|---|
isEmpty |
| Method Detail |
|---|
public void add(int index,
double k)
add in interface DoubleListList.add(int,Object)public boolean add(double k)
add in interface DoubleCollectionadd 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,
Collection<? extends Double> c)
addAll in interface List<Double>public boolean addAll(Collection<? extends Double> c)
addAll in interface Collection<Double>addAll in interface List<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 DoubleIterator 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 Iterable<Double>iterator in interface Collection<Double>iterator in interface List<Double>iterator in class AbstractDoubleCollectionpublic DoubleListIterator listIterator()
DoubleList
listIterator in interface DoubleListlistIterator in interface List<Double>DoubleList.listIterator()public DoubleListIterator listIterator(int index)
DoubleList
listIterator in interface DoubleListlistIterator in interface List<Double>DoubleList.listIterator(int)public boolean contains(double k)
contains in interface DoubleCollectionCollection.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 List<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)
DoubleList
addElements 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(Object o)
equals in interface Collection<Double>equals in interface List<Double>equals in class Objectpublic int compareTo(List<? extends Double> l)
List, this method performs a lexicographical comparison; otherwise,
it throws a ClassCastException.
compareTo in interface Comparable<List<? extends Double>>l - an list.
List, a negative integer,
zero, or a positive integer as this list is lexicographically less than, equal
to, or greater than the argument.
ClassCastException - if the argument is not a list.public int hashCode()
List.hashCode().
hashCode in interface Collection<Double>hashCode in interface List<Double>hashCode in class 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(Object o)
rem().
remove in interface Collection<Double>remove in interface List<Double>remove in class AbstractDoubleCollection
public 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)
AbstractDoubleCollection
addAll 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,
Double ok)
add in interface List<Double>
public Double set(int index,
Double ok)
set in interface List<Double>public Double get(int index)
get in interface List<Double>public int indexOf(Object ok)
indexOf in interface List<Double>public int lastIndexOf(Object ok)
lastIndexOf in interface List<Double>public Double remove(int index)
remove in interface List<Double>public void push(Double o)
push in interface Stack<Double>o - the object that will become the new top of the stack.public Double pop()
pop in interface Stack<Double>public Double top()
top in interface Stack<Double>public Double peek(int i)
peek in interface Stack<Double>i-th element on the stack; 0 represents the top.public String toString()
toString in class AbstractDoubleCollection
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||