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.


Constructor Index

 o doubleArray0D()
Create a 0-dimensional array with a 0-valued element.
 o doubleArray0D(double)
Create a 0-dimensional array.
 o doubleArray0D(double[], int)
Create a 0-dimensional array as a section of another array.

Method Index

 o assign(double)
Assign a scalar value to all elements of the array.
 o assign(doubleArray0D)
Assign the values from another zero-dimensional array to this array.
 o get()
Returns the value of the element of the 0-dimensional array, if any.
 o get(int[])
Return the value of an element of the array.
 o rank()
Return the rank of the 0-dimensional array, i.e.
 o set(double)
Sets the value of the element of the 0-dimensional array, if any.
 o set(int[], double)
Set the value of an element of the array.
 o shape()
Returns the shape of a 0-dimensional array.
 o size()
Return the number of elements in the array.
 o size(int)
A 0-dimensional array does not have any axis.

Constructors

 o doubleArray0D
 public doubleArray0D()
Create a 0-dimensional array with a 0-valued element.

 o 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
 o 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).

Methods

 o rank
 public int rank()
Return the rank of the 0-dimensional array, i.e. 0.

Overrides:
rank in class doubleArray
 o 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
 o 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
 o shape
 public int[] shape()
Returns the shape of a 0-dimensional array. This is an int[] of length 0.

Overrides:
shape in class doubleArray
 o 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
 o 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
 o get
 public double get()
Returns the value of the element of the 0-dimensional array, if any.

 o 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
 o assign
 public void assign(double d)
Assign a scalar value to all elements of the array.

Parameters:
d - value to be assigned
 o 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