Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
gov.llnl.sidl.BaseArray
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.
Nested Class Summary | |
static class |
|
Constructor Summary | |
| |
|
Method Summary | |
void |
|
void |
|
void |
|
int |
|
boolean |
|
boolean |
|
int |
|
int |
|
abstract void |
|
BaseArray |
|
int |
|
int |
|
int |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
protected void |
|
void |
|
int |
|
protected void |
|
long |
|
boolean |
|
boolean |
|
int |
|
void |
|
protected void |
|
void |
|
void |
|
int |
|
int |
|
protected BaseArray()
Construct an empty array object. This object must be allocated before any actions are performed on the array data.
protected BaseArray(long array, boolean owner)
Create an array using an IOR array pointer. The pointer value may be zero (representing null). If the owner flag is true, then the array will be deallocated when this object disappears.
public void _addRef()
Native method adds 1 to array's reference count. Not for users but for internal babel stuff.
public void _deallocate()
Deallocate deletes java's reference to the array (calls deleteRef) But does not (nessecarily) case the array to be GCed.
public void _destroy()
Native method to destroy the array. This will be called by the object finalizer if the array is owned by this object.
public int _dim()
Native method to get the dimension of the array. This method will be implemented in subclasses as a native method.
public boolean _isColumnOrder()
Native method returns true if array is ColumnOrder. This method will be implemented in subclasses as a native method.
public boolean _isRowOrder()
Native method returns true if array if RowOrder. This method will be implemented in subclasses as a native method.
public int _length(int dim)
Routine to get the length of the array at the specified dimension
public int _lower(int dim)
Native method to fetch the specified lower bound of the array. This method will be implemented in subclasses as a native method. The specified array dimension must be between zero and the array dimension minus one. Invalid values will have unpredictable (but almost certainly bad) results.
public 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. This routine assumes that the dimension and indices are valid.
public 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. Useful if you wish to keep a copy of an incoming array
public int _stride(int dim)
Native method to fetch the stride of the specified dimen of the array. This method will be implemented in subclasses as a native method. The specified array dimension must be between zero and the array dimension minus one. Invalid values will have unpredictable (but almost certainly bad) results.
public int _type()
Native method returns the enumerated type of this array
public int _upper(int dim)
Native method to fetch the specified upper bound of the array. This method will be implemented in subclasses as a native method. The specified array dimension must be between zero and the array dimension minus one. Invalid values will have unpredictable (but almost certainly bad) results.
protected void checkBounds(int i)
Check that the index is valid for the array. A null pointer exception is thrown if the arry is null. An array index out of bounds exception is thrown if the index is out of bounds.
protected void checkBounds(int i, int j)
Check that the indices are valid for the array. A null pointer exception is thrown if the arry is null. An array index out of bounds exception is thrown if the index is out of bounds.
protected void checkBounds(int i, int j, int k)
Check that the indices are valid for the array. A null pointer exception is thrown if the arry is null. An array index out of bounds exception is thrown if the index is out of bounds.
protected void checkBounds(int i, int j, int k, int l)
Check that the indices are valid for the array. A null pointer exception is thrown if the arry is null. An array index out of bounds exception is thrown if the index is out of bounds.
protected void checkBounds(int i, int j, int k, int l, int m)
Check that the indices are valid for the array. A null pointer exception is thrown if the arry is null. An array index out of bounds exception is thrown if the index is out of bounds.
protected void checkBounds(int i, int j, int k, int l, int m, int n)
Check that the indices are valid for the array. A null pointer exception is thrown if the arry is null. An array index out of bounds exception is thrown if the index is out of bounds.
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. A null pointer exception is thrown if the arry is null. An array index out of bounds exception is thrown if the index is out of bounds.
protected void checkDimension(int d)
Check that the array is equal to the specified rank. If the array ranks do not match, anArrayIndexOutOfBoundsException
is thrown. This routine assumes that the array is not null.
protected void checkIndexBounds(int i, int d)
Check that the index is valid for the specified dimension. AnArrayIndexOutOfBoundsException
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 checkNullArray()
Throw aNullPointerException
if the array is null.
public void destroy()
Destroy the existing array and make it null. This method deallocates the IOR array reference if we are the owner and the reference is not null. The new array reference is null.
public int dim()
Return the dimension of the array. If the array is null, then the dimension is zero.
protected void finalize() throws Throwable
The finalizer of this object deallocates the IOR array reference if we are the owner and the referece is not null.
public long get_ior_pointer()
Return the pointer to the implementation of the Array (A special function for Object arrays, No touchie!
public boolean get_owner()
Return the array owner flag (A special function for Object arrays, No touchie!
public boolean isNull()
Check whether the array referenced by this object is null.
public int lower(int dim)
Return the lower index of the array corresponding to the specified array dimension. This routine will throw a null pointer exception if the object is null or an array index out of bounds exception if the specified array dimension is not valid.
public void reallocate(int dim, int[] lower, int[] upper, boolean isRow)
Reallocate array data using the specified dimension and lower and upper bounds. Old array data is deleted. Each of the lower and upper bounds arrays must containdim
elements. Upper array bounds are inclusive. An array index out of bounds exception is thrown if any of the indices are invalid.
protected void reset(long array, boolean owner)
Destroy existing array data (if present and owner) and assign the new array pointer and owner.
public void set_ior_pointer(long p)
Set the pointer to the implementation of the Array (A special function for Object arrays, No touchie!
public void set_owner(boolean p)
Return the array owner flag (A special function for Object arrays, No touchie!
public int stride(int dim)
Return the stride of the array corresponding to the specified array dimension. This routine will throw a null pointer exception if the object is null or an array index out of bounds exception if the specified array dimension is not valid.
public int upper(int dim)
Return the upper index of the array corresponding to the specified array dimension. The array runs from the lower bound to the upper bound, inclusive. This routine will throw a null pointer exception if the object is null or an array index out of bounds exception if the specified array dimension is not valid.