All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.math.array.ObjectArray0D
java.lang.Object
|
+----com.ibm.math.array.Array
|
+----com.ibm.math.array.ObjectArray
|
+----com.ibm.math.array.ObjectArray0D
- public final class ObjectArray0D
- extends ObjectArray
ObjectArray0D = 0-dimensional array of Objects
The ObjectArray0D concrete class implements 0-dimensional arrays
of Objects. 0-dimensional arrays can either be instantiated directly
through constructors, or they can begenerated by extracting sections
from other 0- or higher-dimensional arrays.
-
ObjectArray0D()
- Create a 0-dimensional array of a certain shape.
-
ObjectArray0D(Object)
- Create a 0-dimensional array, with shape and values defined by
a Java Object.
-
ObjectArray0D(ObjectArray0D)
- Create a new 0-dimensional array as a copy of a given
ObjectArray0D
-
assign(Object)
- Assign a scalar value to all elements of the array.
-
assign(ObjectArray0D)
- Assign the values from another 0-dimensional array to this array.
-
get()
- Return the value of an element of the array.
-
get(int[])
- Return the value of an element of the array.
-
last(int)
- Return the index of the last element along its i-th axis.
-
permuteAxes()
- Permute the axes of this array, thus creating a reference
to its (generic) transpose.
-
permuteAxes(int[])
- Permute the axes of this array, thus creating a reference
to its (generic) transpose.
-
rank()
- Return the rank of the 0-dimensional array, 0.
-
reshape()
- This method reshapes this array into an array with
rank 0, each parameter gives the size
in each array dimension, the array returned has a copy
of the data from this array, it does not share data
with this array
-
reshape(int)
- This method reshapes this array into an array with
rank 1, each parameter gives the size
in each array dimension, the array returned has a copy
of the data from this array, it does not share data
with this array
-
reshape(int, int)
- This method reshapes this array into an array with
rank 2, each parameter gives the size
in each array dimension, the array returned has a copy
of the data from this array, it does not share data
with this array
-
reshape(int, int, int)
- This method reshapes this array into an array with
rank 3, each parameter gives the size
in each array dimension, the array returned has a copy
of the data from this array, it does not share data
with this array
-
reshape(int[])
- This method is the implementation of the Array interface
reshape that simply call the apropriate version of reshape
given the target rank.
-
section()
- Extract a 0-dimensional section from the array.
-
set(int[], Object)
- Set the value of an element of the array.
-
set(Object)
- Set the value of an element of the array.
-
shape()
- Return the shape of the array as an int[] I of length 0.
-
size()
- Return the number of elements in the array.
-
size(int)
- Return the extent of the array along its i-th axis.
-
toJava()
- Transforms this ObjectArray0D to a Object.
ObjectArray0D
public ObjectArray0D() throws InvalidArrayShapeException
- Create a 0-dimensional array of a certain shape.
Elements are 0-valued
- Throws: InvalidArrayShapeException
- all extents must be nonnegative
ObjectArray0D
public ObjectArray0D(ObjectArray0D arrayin)
- Create a new 0-dimensional array as a copy of a given
ObjectArray0D
- Parameters:
- arrayin - Array to copy
ObjectArray0D
public ObjectArray0D(Object datain) throws InvalidArrayShapeException
- Create a 0-dimensional array, with shape and values defined by
a Java Object.
- Parameters:
- datain - Java Object defining shape and values of the array
- Throws: InvalidArrayShapeException
- The Java array must be rectangular
assign
public void assign(Object value)
- Assign a scalar value to all elements of the array.
- Parameters:
- d - value to be assigned
assign
public void assign(ObjectArray0D arrayin) throws NonconformingArrayException
- Assign the values from another 0-dimensional array to this array.
- Parameters:
- a - array with source values
- Throws: NonconformingArrayException
- arrays must be of same shape
rank
public int rank()
- Return the rank of the 0-dimensional array, 0.
- Overrides:
- rank in class Array
shape
public int[] shape()
- Return the shape of the array as an int[] I of length 0.
- Overrides:
- shape in class Array
size
public int size()
- Return the number of elements in the array.
- Returns:
- the total number of elements
- Overrides:
- size in class Array
size
public int size(int i) throws InvalidArrayAxisException
- Return the extent of the array along its i-th axis.
- Parameters:
- i - array axis (0 <= i < rank())
- Returns:
- the number of elements along axis i
- Throws: InvalidArrayAxisException
- i must be between 0 and -1
- Overrides:
- size in class Array
last
public int last(int i) throws InvalidArrayAxisException
- Return the index of the last element along its i-th axis.
the value returned is simply size(i)-1, but is convenient
to have such a method because last(i) is more readable than
size(i)-1.
- Parameters:
- i - array axis (0 <= i < rank())
- Returns:
- the index of the last element along axis i
- Throws: InvalidArrayAxisException
- i must be between 0 and -1
- Overrides:
- last in class Array
permuteAxes
public Array permuteAxes(int permarray[]) throws InvalidArrayAxisException
- Permute the axes of this array, thus creating a reference
to its (generic) transpose.
- Parameters:
- array - an array indicating the permutation to be done.
ex: for a 2D array array2D.PermuteAxis({1,0});
would permute the array, but array2D.PermuteAxis({0,1});
returns the same array
- Throws: InvalidArrayAxisException
- 0 <= a0,a1 <= 1
- Overrides:
- permuteAxes in class Array
permuteAxes
public ObjectArray0D permuteAxes() throws InvalidArrayAxisException
- Permute the axes of this array, thus creating a reference
to its (generic) transpose.
- Throws: InvalidArrayAxisException
- Axes must be in valid range and all different
reshape
public Array reshape(int size[]) throws NonconformingArrayException
- This method is the implementation of the Array interface
reshape that simply call the apropriate version of reshape
given the target rank.
- Parameters:
- size - size[i] is the extent of the result array along the i axis.
- Throws: NonconformingArrayException
- The size of the resulting array
must be compatible with this array, and in the range of ranks supported
by this implementation.
- Overrides:
- reshape in class Array
reshape
public ObjectArray0D reshape() throws NonconformingArrayException
- This method reshapes this array into an array with
rank 0, each parameter gives the size
in each array dimension, the array returned has a copy
of the data from this array, it does not share data
with this array
- Throws: NonconformingArrayException
- the product of all parameters
must be equal to size of this array
reshape
public ObjectArray1D reshape(int size0) throws NonconformingArrayException
- This method reshapes this array into an array with
rank 1, each parameter gives the size
in each array dimension, the array returned has a copy
of the data from this array, it does not share data
with this array
- Parameters:
- size0: - extent of resulting array along axis #0
- Throws: NonconformingArrayException
- the product of all parameters
must be equal to size of this array
reshape
public ObjectArray2D reshape(int size0,
int size1) throws NonconformingArrayException
- This method reshapes this array into an array with
rank 2, each parameter gives the size
in each array dimension, the array returned has a copy
of the data from this array, it does not share data
with this array
- Parameters:
- size0: - extent of resulting array along axis #0
- size1: - extent of resulting array along axis #1
- Throws: NonconformingArrayException
- the product of all parameters
must be equal to size of this array
reshape
public ObjectArray3D reshape(int size0,
int size1,
int size2) throws NonconformingArrayException
- This method reshapes this array into an array with
rank 3, each parameter gives the size
in each array dimension, the array returned has a copy
of the data from this array, it does not share data
with this array
- Parameters:
- size0: - extent of resulting array along axis #0
- size1: - extent of resulting array along axis #1
- size2: - extent of resulting array along axis #2
- Throws: NonconformingArrayException
- the product of all parameters
must be equal to size of this array
section
public ObjectArray0D section() throws ArrayIndexOutOfBoundsException
- Extract a 0-dimensional section from the array.
- Throws: ArrayIndexOutOfBoundsException
- indices must be valid
get
public Object 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 ObjectArray
get
public Object get() throws ArrayIndexOutOfBoundsException
- Return the value of an element of the array.
set
public void set(int index[],
Object 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 ObjectArray
set
public void set(Object val) throws ArrayIndexOutOfBoundsException
- Set the value of an element of the array.
- Parameters:
- val - value to which element is set
toJava
public Object toJava()
- Transforms this ObjectArray0D to a Object.
All Packages Class Hierarchy This Package Previous Next Index