Servertec
Jenie
1.0.1 09/04/2005

stec.jenie
Class NativeArray

java.lang.Object
  extended by stec.jenie.NativeObject
      extended by stec.jenie.NativeArray
Direct Known Subclasses:
BOOLArray, DOUBLEArray, FLOATArray, INT16Array, INT32Array, INT64Array, INT8Array, INTArray, PointerArray, StructureArray, UINT16Array, UINT32Array, UINT64Array, UINT8Array, UINTArray, UnionArray

public abstract class NativeArray
extends NativeObject

Base class that all native arrays must extend.

Since:
1.0.0 12/05/2004

Constructor Summary
NativeArray(int[] dimensions, int element_size)
          Constructs a new native array with the specified dimensions and element size.
NativeArray(NativeArray native_array)
          Constructs a new native array using dimensions and element size of the specified native array.
NativeArray(Pointer pointer, int[] dimensions, int element_size)
          Constructs a new native array using the specified pointer, dimensions and element size.
NativeArray(Pointer pointer, NativeArray native_array)
          Constructs a new native array using the specified pointer and dimensions and element size from the specified native array.
 
Method Summary
 boolean equals(java.lang.Object object)
          Returns whether this native array equals the specified native array.
 int[] getDimensions()
          Returns the dimensions of this native array.
 int getElementSize()
          Returns the element size of this native array.
 int getOffset(int index)
          Returns the byte offset into the native array of the specified index.
 int getOffset(int[] indexes)
          Returns the byte offset into the native array of the specified indexes.
 int getOffset(int row, int column)
          Returns the byte offset into the native array of the specified row and column.
 int getOffset(int row_index, int column_index, int value_index)
          Returns the byte offset into the native array of the specified row and column.
static int[] i2a(int value)
          Returns a one dimension integer array containing the specified value as its only element.
static int[] i2a(int value1, int value2)
          Returns a two dimensions integer array containing the specified values as its element values.
static int[] i2a(int value1, int value2, int value3)
          Returns a three dimensions integer array containing the specified values as its element values.
 
Methods inherited from class stec.jenie.NativeObject
clone, getAlignment, getNativeAddress, getNativeBuffer, getNativeBufferHandle, hashCode, setNativeBuffer, setNativeBuffer, setNativeBuffer, size
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NativeArray

public NativeArray(int[] dimensions,
                   int element_size)
            throws java.lang.OutOfMemoryError,
                   java.lang.IllegalArgumentException
Constructs a new native array with the specified dimensions and element size.

Parameters:
dimensions - an integer array of one or more dimensions.
element_size - the size in bytes of an element in the array.
Throws:
java.lang.OutOfMemoryError - if there is not enough free memory.
java.lang.IllegalArgumentException - if any of the specified parameters are invalid.

NativeArray

public NativeArray(NativeArray native_array)
            throws java.lang.OutOfMemoryError,
                   java.lang.IllegalArgumentException
Constructs a new native array using dimensions and element size of the specified native array.

Parameters:
native_array - the native array to use.
Throws:
java.lang.OutOfMemoryError - if there is not enough free memory.
java.lang.IllegalArgumentException - if any of the specified parameters are invalid.

NativeArray

public NativeArray(Pointer pointer,
                   int[] dimensions,
                   int element_size)
            throws java.lang.IllegalArgumentException
Constructs a new native array using the specified pointer, dimensions and element size.

Parameters:
pointer - the pointer to the native array.
dimensions - an integer array of one or more dimensions.
element_size - the size in bytes of an element in the array.
Throws:
java.lang.IllegalArgumentException - if any of the specified parameters are invalid.

NativeArray

public NativeArray(Pointer pointer,
                   NativeArray native_array)
            throws java.lang.IllegalArgumentException
Constructs a new native array using the specified pointer and dimensions and element size from the specified native array.

Parameters:
pointer - the pointer to the native array.
dimensions - an integer array of one or more dimensions.
element_size - the size in bytes of an element in the array.
Throws:
java.lang.IllegalArgumentException - if any of the specified parameters are invalid.
Method Detail

i2a

public static final int[] i2a(int value)
Returns a one dimension integer array containing the specified value as its only element.

Parameters:
value - the value to use.
Returns:
the one dimensions integer array.

i2a

public static final int[] i2a(int value1,
                              int value2)
Returns a two dimensions integer array containing the specified values as its element values.

Parameters:
value1 - the first value.
value2 - the second value.
Returns:
the one dimensions integer array.

i2a

public static final int[] i2a(int value1,
                              int value2,
                              int value3)
Returns a three dimensions integer array containing the specified values as its element values.

Parameters:
value1 - the first value.
value2 - the second value.
value3 - the third value.
Returns:
the one dimensions integer array.

getDimensions

public int[] getDimensions()
Returns the dimensions of this native array.

Returns:
the dimensions of this native array.

getElementSize

public int getElementSize()
Returns the element size of this native array.

Returns:
the element size of this native array.

getOffset

public int getOffset(int[] indexes)
              throws java.lang.IllegalArgumentException
Returns the byte offset into the native array of the specified indexes.

Parameters:
indexes - the indexes.
Returns:
the byte offset into the native array.
Throws:
java.lang.IllegalArgumentException - if the specified parameter is not valid.

getOffset

public int getOffset(int row,
                     int column)
              throws java.lang.IllegalArgumentException
Returns the byte offset into the native array of the specified row and column.

Parameters:
row - the row.
column - the column.
Returns:
the byte offset into the native array.
Throws:
java.lang.IllegalArgumentException - if any of the specified parameters is not valid.

getOffset

public int getOffset(int row_index,
                     int column_index,
                     int value_index)
              throws java.lang.IllegalArgumentException
Returns the byte offset into the native array of the specified row and column.

Parameters:
row_index - the row.
column_index - the column.
value_index - the value.
Returns:
the byte offset into the native array.
Throws:
java.lang.IllegalArgumentException - if any of thespecified parameters is not valid.

getOffset

public int getOffset(int index)
              throws java.lang.IllegalArgumentException
Returns the byte offset into the native array of the specified index.

Parameters:
index - the index.
Returns:
the byte offset into the native array.
Throws:
java.lang.IllegalArgumentException - if the specified parameter is not valid.

equals

public boolean equals(java.lang.Object object)
Returns whether this native array equals the specified native array.

Overrides:
equals in class NativeObject
Parameters:
object - the native array to compare against.
Returns:
whether this native array equals the specified native array.

Servertec
Jenie
1.0.1 09/04/2005

Copyright © 2004-2005 Servertec. All rights reserved.