public abstract class BaseArray
extends java.lang.Object
BaseArray
is the base array for all sidl Java arrays
in the run-time system. This class provides basic support for bounds
checking and management of the IOR array pointer object.Modifier and Type | Class and Description |
---|---|
static class |
BaseArray.Holder
Holder class for inout and out arguments.
|
Modifier and Type | Field and Description |
---|---|
protected long |
d_array |
protected boolean |
d_owner |
Modifier | Constructor and Description |
---|---|
protected |
BaseArray()
Construct an empty array object.
|
protected |
BaseArray(long array,
boolean owner)
Create an array using an IOR array pointer.
|
Modifier and Type | Method and Description |
---|---|
void |
_addRef()
Native method adds 1 to array's reference count.
|
void |
_deallocate()
Deallocate deletes java's reference to the array (calls deleteRef)
But does not (nessecarily) case the array to be GCed.
|
void |
_destroy()
Native method to destroy the array.
|
int |
_dim()
Native method to get the dimension of the array.
|
boolean |
_isColumnOrder()
Native method returns true if array is ColumnOrder.
|
boolean |
_isRowOrder()
Native method returns true if array if RowOrder.
|
int |
_length(int dim)
Routine to get the length of the array at the specified dimension
|
int |
_lower(int dim)
Native method to fetch the specified lower bound of the array.
|
abstract void |
_reallocate(int dim,
int[] lower,
int[] upper,
boolean isRow)
Abstract method to reallocate array data using the specified dimension,
lower bounds, and upper bounds.
|
BaseArray |
_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 |
_stride(int dim)
Native method to fetch the stride of the specified dimen of the array.
|
int |
_type()
Native method returns the enumerated type of this array
|
int |
_upper(int dim)
Native method to fetch the specified upper bound of the array.
|
protected void |
checkBounds(int i)
Check that the index is valid for the array.
|
protected void |
checkBounds(int i,
int j)
Check that the indices are valid for the array.
|
protected void |
checkBounds(int i,
int j,
int k)
Check that the indices are valid for the array.
|
protected void |
checkBounds(int i,
int j,
int k,
int l)
Check that the indices are valid for the array.
|
protected void |
checkBounds(int i,
int j,
int k,
int l,
int m)
Check that the indices are valid for the array.
|
protected void |
checkBounds(int i,
int j,
int k,
int l,
int m,
int n)
Check that the indices are valid for the array.
|
protected void |
checkBounds(int i,
int j,
int k,
int l,
int m,
int n,
int o)
Check that the indices are valid for the array.
|
protected void |
checkDimension(int d)
Check that the array is equal to the specified rank.
|
protected void |
checkIndexBounds(int i,
int d)
Check that the index is valid for the specified dimension.
|
protected void |
checkNullArray()
Throw a
NullPointerException if the array is null. |
void |
destroy()
Destroy the existing array and make it null.
|
int |
dim()
Return the dimension of the array.
|
protected void |
finalize()
The finalizer of this object deallocates the IOR array reference if
we are the owner and the referece is not null.
|
long |
get_ior_pointer()
Return the pointer to the implementation of the Array (A special
function for Object arrays, No touchie!
|
boolean |
get_owner()
Return the array owner flag (A special function for Object arrays, No touchie!
|
boolean |
isNull()
Check whether the array referenced by this object is null.
|
int |
lower(int dim)
Return the lower index of the array corresponding to the specified
array dimension.
|
void |
reallocate(int dim,
int[] lower,
int[] upper,
boolean isRow)
Reallocate array data using the specified dimension and lower and
upper bounds.
|
protected void |
reset(long array,
boolean owner)
Destroy existing array data (if present and owner) and assign the
new array pointer and owner.
|
void |
set_ior_pointer(long p)
Set the pointer to the implementation of the Array (A special
function for Object arrays, No touchie!
|
void |
set_owner(boolean p)
Return the array owner flag (A special function for Object arrays, No touchie!
|
int |
stride(int dim)
Return the stride of the array corresponding to the specified
array dimension.
|
int |
upper(int dim)
Return the upper index of the array corresponding to the specified
array dimension.
|
protected BaseArray()
protected BaseArray(long array, boolean owner)
protected void reset(long array, boolean owner)
public boolean isNull()
public int _type()
public int _dim()
public int _lower(int dim)
public int _upper(int dim)
public int _length(int dim)
public int _stride(int dim)
public boolean _isColumnOrder()
public boolean _isRowOrder()
public void _addRef()
public BaseArray _smartCopy()
public void _deallocate()
public void _destroy()
public abstract void _reallocate(int dim, int[] lower, int[] upper, boolean isRow)
public void destroy()
public long get_ior_pointer()
public void set_ior_pointer(long p)
public boolean get_owner()
public void set_owner(boolean p)
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
public void reallocate(int dim, int[] lower, int[] upper, boolean isRow)
dim
elements. Upper array
bounds are inclusive. An array index out of bounds exception is thrown
if any of the indices are invalid.public int dim()
protected void checkNullArray()
NullPointerException
if the array is null.protected void checkDimension(int d)
ArrayIndexOutOfBoundsException
is thrown. This routine assumes that the array is not null.protected void checkIndexBounds(int i, int d)
ArrayIndexOutOfBoundsException
is thrown if the index
is out of bounds. This routine assumes both that the array pointer
is not null and that the dimension argument is valid.protected void checkBounds(int i)
protected void checkBounds(int i, int j)
protected void checkBounds(int i, int j, int k)
protected void checkBounds(int i, int j, int k, int l)
protected void checkBounds(int i, int j, int k, int l, int m)
protected void checkBounds(int i, int j, int k, int l, int m, int n)
protected void checkBounds(int i, int j, int k, int l, int m, int n, int o)
public int lower(int dim)
public int upper(int dim)
public int stride(int dim)