|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A type-specific List
; provides some additional methods that use polymorphism to reduce type juggling.
Note that this type-specific interface extends Comparable
: it is expected that implementing
classes perform a lexicographical comparison using the standard operator "less then" for primitive types,
and the usual compareTo()
method for objects.
Besides polymorphic methods, this interfaces specifies methods to copy into an array or remove contiguous sublists. Although the abstract implementation of this interface provides simple, one-by-one implementations of these methods, it is expected that concrete implementation override them with optimized versions.
List
Method Summary | |
void |
add(int index,
double key)
|
boolean |
addAll(DoubleList c)
|
boolean |
addAll(int index,
DoubleCollection c)
|
boolean |
addAll(int index,
DoubleList c)
|
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)
Add (hopefully quickly) elements to this type-specific list. |
DoubleListIterator |
doubleListIterator()
Returns a type-specific list iterator on the list. |
DoubleListIterator |
doubleListIterator(int index)
Returns a type-specific list iterator on the list starting at a given index. |
DoubleList |
doubleSubList(int from,
int to)
|
double |
getDouble(int index)
|
void |
getElements(int from,
double[] a,
int offset,
int length)
Copies (hopefully quickly) elements of this type-specific list into the given array. |
int |
indexOf(double k)
|
int |
lastIndexOf(double k)
|
double |
removeDouble(int index)
|
void |
removeElements(int from,
int to)
Removes (hopefully quickly) elements of this type-specific list. |
double |
set(int index,
double k)
|
void |
size(int size)
Sets the size of this list. |
Methods inherited from interface java.util.List |
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray |
Methods inherited from interface java.lang.Comparable |
compareTo |
Methods inherited from interface it.unimi.dsi.fastutil.doubles.DoubleCollection |
add, addAll, contains, containsAll, doubleIterator, rem, removeAll, retainAll, toArray, toDoubleArray, toDoubleArray |
Method Detail |
public DoubleListIterator doubleListIterator()
The iterator returned by the List.listIterator()
method and by this
method are identical; however, using this method you can save a type casting.
List.listIterator()
public DoubleListIterator doubleListIterator(int index)
The iterator returned by the List.listIterator()
method and by this
method are identical; however, using this method you can save a type casting.
List.listIterator(int)
public DoubleList doubleSubList(int from, int to)
List.subList(int,int)
public void size(int size)
If the specified size is smaller than the current size, the last elements are
discarded. Otherwise, they are filled with 0/null
/false
.
size
- the new size.public void getElements(int from, double[] a, int offset, int length)
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)
from
- the start index (inclusive).to
- the end index (exclusive).public void addElements(int index, double[] a)
index
- the index at which to add elements.a
- the array containing the elements.public void addElements(int index, double[] a, int offset, int length)
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 void add(int index, double key)
List.add(int,Object)
public boolean addAll(int index, DoubleCollection c)
List.add(int,Object)
public boolean addAll(int index, DoubleList c)
List.add(int,Object)
public boolean addAll(DoubleList c)
List.add(int,Object)
public double getDouble(int index)
List.get(int)
public int indexOf(double k)
List.indexOf(Object)
public int lastIndexOf(double k)
List.lastIndexOf(Object)
public double removeDouble(int index)
List.remove(int)
public double set(int index, double k)
List.set(int,Object)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |