All Packages Class Hierarchy This Package Previous Next Index
Class array.doubleArray0D
java.lang.Object
|
+----array.doubleArray
|
+----array.doubleArray0D
- public final class doubleArray0D
- extends doubleArray
doubleArray0D = 0-dimensional array of doubles (scalar)
The doubleArray0D concrete class implements 0-dimensional arrays
of doubles. 0-dimensional arrays are scalars. Although they can
be instantiated directly through constructors,
0-dimensional arrays are typically
generated by extracting single-element sections from
higher-dimensional arrays.
-
doubleArray0D()
- Create a 0-dimensional array with a 0-valued element.
-
doubleArray0D(double)
- Create a 0-dimensional array.
-
doubleArray0D(double[], int)
- Create a 0-dimensional array as a section of another array.
-
assign(double)
- Assign a scalar value to all elements of the array.
-
assign(doubleArray0D)
- Assign the values from another zero-dimensional array to this array.
-
get()
- Returns the value of the element of the 0-dimensional array,
if any.
-
get(int[])
- Return the value of an element of the array.
-
rank()
- Return the rank of the 0-dimensional array, i.e.
-
set(double)
- Sets the value of the element of the 0-dimensional array, if any.
-
set(int[], double)
- Set the value of an element of the array.
-
shape()
- Returns the shape of a 0-dimensional array.
-
size()
- Return the number of elements in the array.
-
size(int)
- A 0-dimensional array does not have any axis.
doubleArray0D
public doubleArray0D()
- Create a 0-dimensional array with a 0-valued element.
doubleArray0D
public doubleArray0D(double a)
- Create a 0-dimensional array. The value of the element
is specified by a parameter.
- Parameters:
- a - value of element
doubleArray0D
protected doubleArray0D(double d[],
int a)
- Create a 0-dimensional array as a section of another array.
Internal use within the package only.
A 0-dimensional array section can be empty (have 0 elements).
rank
public int rank()
- Return the rank of the 0-dimensional array, i.e. 0.
- Overrides:
- rank in class doubleArray
size
public int size()
- Return the number of elements in the array. This number is
0 if the array is empty, 1 otherwise.
- Overrides:
- size in class doubleArray
size
public int size(int i) throws InvalidArrayAxisException
- A 0-dimensional array does not have any axis. Therefore,
any invocation of size(i) throws an
InvalidArrayAxisException exception.
- Parameters:
- i - array axis (0 <= i < rank())
- Throws: InvalidArrayAxisException
- always thrown
- Overrides:
- size in class doubleArray
shape
public int[] shape()
- Returns the shape of a 0-dimensional array. This is an
int[] of length 0.
- Overrides:
- shape in class doubleArray
get
public double get(int index[]) throws InvalidArrayIndexException, ArrayIndexOutOfBoundsException
- Return the value of an element of the array.
- Parameters:
- index - index[i] = index along i-th axis, 0 <= index[i] < size(i)
- Throws: InvalidArrayIndexException
- index[] must be of length 0
- Overrides:
- get in class doubleArray
set
public void set(int index[],
double d) throws InvalidArrayIndexException, ArrayIndexOutOfBoundsException
- Set the value of an element of the array.
- Parameters:
- index - index[i] = index along i-th axis, 0 <= index[i] < size(i)
- d - value to which element is set
- Throws: InvalidArrayIndexException
- index[] must be of length 0
- Overrides:
- set in class doubleArray
get
public double get()
- Returns the value of the element of the 0-dimensional array,
if any.
set
public void set(double d)
- Sets the value of the element of the 0-dimensional array, if any.
- Parameters:
- d - value for the element
assign
public void assign(double d)
- Assign a scalar value to all elements of the array.
- Parameters:
- d - value to be assigned
assign
public void assign(doubleArray0D a) throws NonconformingArrayException
- Assign the values from another zero-dimensional array to this array.
- Parameters:
- a - array with source value
- Throws: NonconformingArrayException
- arrays must be of same shape
All Packages Class Hierarchy This Package Previous Next Index