|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.jstacs.utils.DoubleList
public final class DoubleList
A simple list of primitive type double.
Constructor Summary | |
---|---|
DoubleList()
This is the default constructor that creates a DoubleList with initial length 10. |
|
DoubleList(int size)
This is the default constructor that creates a DoubleList with initial length size . |
Method Summary | |
---|---|
void |
add(double val)
Adds the element val at the end of the list. |
void |
add(double val,
int fromIndex,
int toIndex)
Adds the element val from fromIndex to toIndex (exclusive). |
void |
clear()
Removes all elements from the list. |
double |
get(int index)
Returns the element with the specified index . |
int |
length()
Returns the number of inserted elements. |
void |
multiply(int start,
int end,
double factor)
Multiplies all value in the list from index start to end with the value factor |
double[] |
toArray()
This method returns a double array containing all elements of the list. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DoubleList()
public DoubleList(int size) throws IllegalArgumentException
size
.
size
- the initial size; has to be positive
IllegalArgumentException
- if the size is less than 1Method Detail |
---|
public final void add(double val)
val
at the end of the list.
val
- the element that should be inserted.public final void add(double val, int fromIndex, int toIndex)
val
from fromIndex to toIndex
(exclusive).
val
- the element that should be insertedfromIndex
- the start index (inclusive)toIndex
- the end index (exclusive)public final void clear()
public final double get(int index)
index
.
index
- the specified index
public final int length()
public double[] toArray()
public void multiply(int start, int end, double factor)
start
to end
with the value factor
start
- the start index (inclusive)end
- the end index (exclusive)factor
- the factor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |