sidl

Class Integer.Array3

Enclosing Class:
Integer

public static class Integer.Array3
extends Integer.Array

Define a three dimensional array of type int. This array representation is used for sidl arrays since it requires no copies to go between Java and sidl. Explicit copies may be made of the array by calling the appropriate get and set methods.

Nested Class Summary

static class
Integer.Array3.Holder

Nested classes/interfaces inherited from class sidl.Integer.Array

Integer.Array.Holder

Nested classes/interfaces inherited from class gov.llnl.sidl.BaseArray

BaseArray.Holder

Field Summary

Fields inherited from class gov.llnl.sidl.BaseArray

d_array, d_owner

Constructor Summary

Array3()
Create an empty three dimensional array.
Array3(int s0, int s1, int s2, boolean isRow)
Create a three dimenstional array of the specified size, with the lower index starting at zero.
Array3(int l0, int l1, int l2, int u0, int u1, int u2, boolean isRow)
Create a three dimensional array using the specified lower and upper bounds (where both bounds are inclusive).
Array3(int[][][] array)
Create a three dimensional array using the specified Java array.
Array3(long array, boolean owner)
Create a three dimensional array directly using the sidl pointer and owner flag.

Method Summary

int
_get(int i, int j, int k)
Get the specified array element without bounds checking.
void
_set(int i, int j, int k, int value)
Set the specified array element without bounds checking.
void
copy(Integer.Array3 dest)
Method Copy copies the elements of 'this' to an already existing array of the same size.
void
fromArray(int[][][] array)
Set the value of the sidl array from the Java array.
int
get(int i, int j, int k)
Get the specified array element with bounds checking.
int
length(int dim)
Routine gets length of the array in the specified dimension
void
reallocate(int l0, int l1, int l2, int u0, int u1, int u2, boolean isRow)
Reallocate array data using the specifed lower and upper bounds.
void
set(int i, int j, int k, int value)
Set the specified array element with bounds checking.
Integer.Array3
smartCopy()
Method smartCopy returns a a copy of a borrowed array, or increments the reference count of an array that manages it's own data.
int[][][]
toArray()
Convert the sidl array into a Java array.

Methods inherited from class sidl.Integer.Array

_copy, _dcast, _get, _reallocate, _set, _slice

Methods inherited from class gov.llnl.sidl.BaseArray

_addRef, _deallocate, _destroy, _dim, _isColumnOrder, _isRowOrder, _length, _lower, _reallocate, _smartCopy, _stride, _type, _upper, checkBounds, checkBounds, checkBounds, checkBounds, checkBounds, checkBounds, checkBounds, checkDimension, checkIndexBounds, checkNullArray, destroy, dim, finalize, get_ior_pointer, get_owner, isNull, lower, reallocate, reset, set_ior_pointer, set_owner, stride, upper

Constructor Details

Array3

public Array3()
Create an empty three dimensional array. The array will need to be initialized before use.

Array3

public Array3(int s0,
              int s1,
              int s2,
              boolean isRow)
Create a three dimenstional array of the specified size, with the lower index starting at zero. This constructor will throw an array bounds out of range exception if the array bounds are invalid.

Array3

public Array3(int l0,
              int l1,
              int l2,
              int u0,
              int u1,
              int u2,
              boolean isRow)
Create a three dimensional array using the specified lower and upper bounds (where both bounds are inclusive). This constructor will throw an array bounds out of range exception if the array bounds are invalid.

Array3

public Array3(int[][][] array)
Create a three dimensional array using the specified Java array. The lower bound(s) of the constructed array will start at zero. An array index out of range exception will be thrown if the bounds are invalid.

Array3

protected Array3(long array,
                 boolean owner)
Create a three dimensional array directly using the sidl pointer and owner flag. This constructor should only be called by the sidl runtime.

Method Details

_get

public int _get(int i,
                int j,
                int k)
Get the specified array element without bounds checking. If the index is invalid, then bad things may happen. If you are unsure whether the index is valid, then use get instead.

_set

public void _set(int i,
                 int j,
                 int k,
                 int value)
Set the specified array element without bounds checking. If the index is invalid, then bad things may happen. If you are unsure whether the index is valid, then use set instead.

copy

public void copy(Integer.Array3 dest)
Method Copy copies the elements of 'this' to an already existing array of the same size.

fromArray

public void fromArray(int[][][] array)
Set the value of the sidl array from the Java array. This method will copy the Java array values into the sidl array, reallocating the memory of the sidl array as necessary. The resulting sidl array will start with a zero lower bound. If the Java array is null, then the sidl array will be null, as well. Note that multidimensional Java arrays must not be ragged; that is, all sub-arrays in a particular dimension must have the same size. Otherwise, some data may be missed or this method may throw an array index out of bounds exception.

get

public int get(int i,
               int j,
               int k)
Get the specified array element with bounds checking. If the index is invalid, then an array index out of bounds exception will be thrown.

length

public int length(int dim)
Routine gets length of the array in the specified dimension

reallocate

public void reallocate(int l0,
                       int l1,
                       int l2,
                       int u0,
                       int u1,
                       int u2,
                       boolean isRow)
Reallocate array data using the specifed lower and upper bounds. The upper bound is inclusive. Previous array data will be freed.

set

public void set(int i,
                int j,
                int k,
                int value)
Set the specified array element with bounds checking. If the index is invalid, then an array index out of bounds exception will be thrown.

smartCopy

public Integer.Array3 smartCopy()
Method smartCopy returns a a copy of a borrowed array, or increments the reference count of an array that manages it's own data. Useful if you wish to keep a copy of an incoming array

toArray

public int[][][] toArray()
Convert the sidl array into a Java array. This method will copy the sidl array into the Java array. The resulting Java array will (obviously) start with a zero lower bound. If the sidl array is empty (null), then a null Java array will be returned.