public class DoubleArray
extends java.lang.Object
| Constructor | Description |
|---|---|
DoubleArray(int initialLength,
double initialValue) |
Constructs a DoubleArray object.
|
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
fill(double value) |
Fills elements of the array with the specified value.
|
boolean |
fill(double value,
int start,
int end) |
Fills a subset of elements of the array with the specified value.
|
double |
get(int n) |
Gets the specified array element.
|
boolean |
set(int n,
double value) |
Sets the specified array element.
|
void |
setLength(int newLength) |
Sets the length of the array.
|
public DoubleArray(int initialLength,
double initialValue)
initialLength - the initial length of the arrayinitialValue - the initial value of all array elementspublic double get(int n)
n - the array indexpublic boolean set(int n,
double value)
n - the array indexvalue - the new value of the elementpublic void setLength(int newLength)
newLength - the new length of the arraypublic boolean fill(double value)
value - the valuepublic boolean fill(double value,
int start,
int end)
value - the valuestart - the first indexend - the last index