All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface array.Array

public interface Array
array = Java array package

The Java array package provides the basic functionality of Fortran 90 arrays in Java. Arrays are multidimensional, rectangular grids of elements. The array class hierarchy is as follows:

Array ----> <type>Array ----> <type>Array<rank>

where Array is an interface, <type>Array is an abstract class and <type>Array<rank> is a (concrete) class. Only objects of class <type>Array<rank> can be instantiated. The following <type>s are valid:

boolean, byte, short, int, long, char, float, double, FloatComplex, DoubleComplex, and Object.

The following <rank>s are valid:

0D (for 0-dimensional arrays), 1D (for 1-dimensional arrays), 2D, 3D, 4D, 5D, 6D, 7D.

Note: This distribution only contains the classes for <type>=double and <rank>=0D,1D,2D,3D.

The Array interface is implemented by all abstract array classes of the form <type>Array. It declares the basic methods that are common to all arrays, independent of <type> and <rank>


Method Index

 o getAsObject(int[])
Return an Object which has the same value as the specified element of the array.
 o rank()
Return the rank of the array.
 o setToObject(int[], Object)
Sets the specified element of the array to a particular value.
 o shape()
Return the shape of the array as an int[] I of length rank().
 o size()
Return the number of elements in the array.
 o size(int)
Return the extent of the array along its i-th axis.

Methods

 o rank
 public abstract int rank()
Return the rank of the array.

 o size
 public abstract int size()
Return the number of elements in the array.

 o size
 public abstract int size(int i) throws InvalidArrayAxisException
Return the extent of the array along its i-th axis.

Parameters:
i - array axis (0 <= i < rank())
Throws: InvalidArrayAxisException
i must be between 0 and rank-1
 o shape
 public abstract int[] shape()
Return the shape of the array as an int[] I of length rank(). I(i) = size(i)

 o getAsObject
 public abstract Object getAsObject(int index[]) throws InvalidArrayIndexException, ArrayIndexOutOfBoundsException
Return an Object which has the same value as the specified 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 equal to rank
 o setToObject
 public abstract void setToObject(int index[],
                                  Object obj) throws InvalidArrayIndexException, ArrayIndexOutOfBoundsException, NullPointerException
Sets the specified element of the array to a particular value.

Parameters:
index - index[i] = index along i-th axis, 0 <= index[i] < size(i)
obj - the array element is set to the value of this Object
Throws: InvalidArrayIndexException
index[] must be of length equal to rank

All Packages  Class Hierarchy  This Package  Previous  Next  Index