public abstract class LargeArray extends Object implements Serializable, Cloneable
| Modifier and Type | Class and Description |
|---|---|
protected static class |
LargeArray.Deallocator
Memory deallocator.
|
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
isConstant |
static int |
LARGEST_SUBARRAY
The largest size of subarray returned by getXXXData() methods.
|
protected long |
length |
protected Object |
parent |
protected long |
ptr |
protected long |
sizeof |
protected LargeArrayType |
type |
| Modifier | Constructor and Description |
|---|---|
protected |
LargeArray()
Creates new instance of this class.
|
|
LargeArray(Object parent,
long nativePointer,
LargeArrayType largeArrayType,
long length)
Creates new instance of this class by wrapping a native pointer.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
clone() |
boolean |
equals(Object o) |
Object |
get_safe(long i)
Returns a value at index i.
|
abstract Object |
get(long i)
Returns a value at index i.
|
boolean |
getBoolean_safe(long i)
Returns a boolean value at index i.
|
abstract boolean |
getBoolean(long i)
Returns a boolean value at index i.
|
abstract boolean[] |
getBooleanData()
If the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this
method returns boolean data.
|
abstract boolean[] |
getBooleanData(boolean[] a,
long startPos,
long endPos,
long step)
If (endPos - startPos) / step is smaller than LargeArray.LARGEST_SUBARRAY, then
this method returns selected elements of this object.
|
byte |
getByte_safe(long i)
Returns a signed byte value at index i.
|
abstract byte |
getByte(long i)
Returns a signed byte value at index i.
|
abstract byte[] |
getByteData()
If the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this
method returns byte data.
|
abstract byte[] |
getByteData(byte[] a,
long startPos,
long endPos,
long step)
If (endPos - startPos) / step is smaller than LargeArray.LARGEST_SUBARRAY, then
this method returns selected elements of this object.
|
abstract Object |
getData()
Returns a reference to the internal data array.
|
double |
getDouble_safe(long i)
Returns a double value at index i.
|
abstract double |
getDouble(long i)
Returns a double value at index i.
|
abstract double[] |
getDoubleData()
If the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this
method returns double data.
|
abstract double[] |
getDoubleData(double[] a,
long startPos,
long endPos,
long step)
If (endPos - startPos) / step is smaller than LargeArray.LARGEST_SUBARRAY, then
this method returns selected elements of this object.
|
float |
getFloat_safe(long i)
Returns a float value at index i.
|
abstract float |
getFloat(long i)
Returns a float value at index i.
|
abstract float[] |
getFloatData()
If the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this
method returns float data.
|
abstract float[] |
getFloatData(float[] a,
long startPos,
long endPos,
long step)
If (endPos - startPos) / step is smaller than LargeArray.LARGEST_SUBARRAY, then
this method returns selected elements of this object.
|
abstract Object |
getFromNative(long i)
Returns a value at index i.
|
int |
getInt_safe(long i)
Returns an int value at index i.
|
abstract int |
getInt(long i)
Returns an int value at index i.
|
abstract int[] |
getIntData()
If the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this
method returns int data.
|
abstract int[] |
getIntData(int[] a,
long startPos,
long endPos,
long step)
If (endPos - startPos) / step is smaller than LargeArray.LARGEST_SUBARRAY, then
this method returns selected elements of this object.
|
long |
getLong_safe(long i)
Returns a long value at index i.
|
abstract long |
getLong(long i)
Returns a long value at index i.
|
abstract long[] |
getLongData()
If the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this
method returns long data.
|
abstract long[] |
getLongData(long[] a,
long startPos,
long endPos,
long step)
If (endPos - startPos) / step is smaller than LargeArray.LARGEST_SUBARRAY, then
this method returns selected elements of this object.
|
static int |
getMaxSizeOf32bitArray()
Returns the maximal size of a 32-bit array.
|
short |
getShort_safe(long i)
Returns a short value at index i.
|
abstract short |
getShort(long i)
Returns a short value at index i.
|
abstract short[] |
getShortData()
If the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this
method returns short data.
|
abstract short[] |
getShortData(short[] a,
long startPos,
long endPos,
long step)
If (endPos - startPos) / step is smaller than LargeArray.LARGEST_SUBARRAY, then
this method returns selected elements of this object.
|
LargeArrayType |
getType()
Returns the type of an array.
|
short |
getUnsignedByte_safe(long i)
Returns an unsigned byte value at index i.
|
abstract short |
getUnsignedByte(long i)
Returns an unsigned byte value at index i.
|
int |
hashCode() |
boolean |
isConstant()
Return true if the array is constant.
|
boolean |
isLarge()
Returns true if the size of an array is larger than LARGEST_SUBARRAY.
|
boolean |
isNumeric()
Returns true if the type of the array is numeric, false otherwise.
|
long |
length()
Returns the length of an array.
|
long |
nativePointer()
Returns the internal pointer address (if isLarge)
|
void |
set_safe(long i,
Object value)
Sets a value at index i.
|
void |
set(long i,
Object value)
Sets a value at index i.
|
void |
setBoolean_safe(long i,
boolean value)
Sets a boolean value at index i.
|
abstract void |
setBoolean(long i,
boolean value)
Sets a boolean value at index i.
|
void |
setByte_safe(long i,
byte value)
Sets a byte value at index i.
|
abstract void |
setByte(long i,
byte value)
Sets a byte value at index i.
|
void |
setDouble_safe(long i,
double value)
Sets a double value at index i.
|
abstract void |
setDouble(long i,
double value)
Sets a double value at index i.
|
void |
setFloat_safe(long i,
float value)
Sets a float value at index i.
|
abstract void |
setFloat(long i,
float value)
Sets a float value at index i.
|
void |
setInt_safe(long i,
int value)
Sets an int value at index i.
|
abstract void |
setInt(long i,
int value)
Sets an int value at index i.
|
void |
setLong_safe(long i,
long value)
Sets a long value at index i.
|
abstract void |
setLong(long i,
long value)
Sets a long value at index i.
|
static void |
setMaxSizeOf32bitArray(int index)
Sets the maximal size of a 32-bit array.
|
void |
setShort_safe(long i,
short value)
Sets a short value at index i.
|
abstract void |
setShort(long i,
short value)
Sets a short value at index i.
|
abstract void |
setToNative(long i,
Object value)
Sets a value at index i.
|
void |
setUnsignedByte_safe(long i,
byte value)
Sets an unsigned value at index i.
|
abstract void |
setUnsignedByte(long i,
short value)
Sets an unsigned byte value at index i.
|
protected void |
zeroNativeMemory(long size)
Initializes allocated native memory to zero.
|
protected LargeArrayType type
protected long length
protected long sizeof
protected boolean isConstant
protected Object parent
protected long ptr
public static final int LARGEST_SUBARRAY
protected LargeArray()
public LargeArray(Object parent, long nativePointer, LargeArrayType largeArrayType, long length)
parent - class instance responsible for handling the pointer's life
cycle, the created instance of LargeArray will prevent the GC from
reclaiming the parent.nativePointer - native pointer to wrap.largeArrayType - type of arraylength - array lengthpublic long nativePointer()
public long length()
public LargeArrayType getType()
public abstract Object get(long i)
i - an indexpublic Object get_safe(long i)
i - an indexpublic abstract Object getFromNative(long i)
i - indexpublic abstract boolean getBoolean(long i)
i - an indexpublic boolean getBoolean_safe(long i)
i - an indexpublic abstract byte getByte(long i)
i - an indexpublic byte getByte_safe(long i)
i - an indexpublic abstract short getUnsignedByte(long i)
i - an indexpublic short getUnsignedByte_safe(long i)
i - an indexpublic abstract short getShort(long i)
i - an indexpublic short getShort_safe(long i)
i - an indexpublic abstract int getInt(long i)
i - an indexpublic int getInt_safe(long i)
i - an indexpublic abstract long getLong(long i)
i - an indexpublic long getLong_safe(long i)
i - an indexpublic abstract float getFloat(long i)
i - an indexpublic float getFloat_safe(long i)
i - an indexpublic abstract double getDouble(long i)
i - an indexpublic double getDouble_safe(long i)
i - an indexpublic abstract Object getData()
public abstract boolean[] getBooleanData()
public abstract boolean[] getBooleanData(boolean[] a,
long startPos,
long endPos,
long step)
a - the array into which the elements are to be stored, if it is big
enough; otherwise, a new array of is allocated for this purpose.startPos - starting position (included)endPos - ending position (excluded)step - step sizepublic abstract byte[] getByteData()
public abstract byte[] getByteData(byte[] a,
long startPos,
long endPos,
long step)
a - the array into which the elements are to be stored, if it is big
enough; otherwise, a new array of is allocated for this purpose.startPos - starting position (included)endPos - ending position (excluded)step - step sizepublic abstract short[] getShortData()
public abstract short[] getShortData(short[] a,
long startPos,
long endPos,
long step)
a - the array into which the elements are to be stored, if it is big
enough; otherwise, a new array of is allocated for this purpose.startPos - starting position (included)endPos - ending position (excluded)step - step sizepublic abstract int[] getIntData()
public abstract int[] getIntData(int[] a,
long startPos,
long endPos,
long step)
a - the array into which the elements are to be stored, if it is big
enough; otherwise, a new array of is allocated for this purpose.startPos - starting position (included)endPos - ending position (excluded)step - step sizepublic abstract long[] getLongData()
public abstract long[] getLongData(long[] a,
long startPos,
long endPos,
long step)
a - the array into which the elements are to be stored, if it is big
enough; otherwise, a new array of is allocated for this purpose.startPos - starting position (included)endPos - ending position (excluded)step - step sizepublic abstract float[] getFloatData()
public abstract float[] getFloatData(float[] a,
long startPos,
long endPos,
long step)
a - the array into which the elements are to be stored, if it is big
enough; otherwise, a new array of is allocated for this purpose.startPos - starting position (included)endPos - ending position (excluded)step - step sizepublic abstract double[] getDoubleData()
public abstract double[] getDoubleData(double[] a,
long startPos,
long endPos,
long step)
a - the array into which the elements are to be stored, if it is big
enough; otherwise, a new array of is allocated for this purpose.startPos - starting position (included)endPos - ending position (excluded)step - step sizepublic void set(long i,
Object value)
i - indexvalue - value to setpublic abstract void setToNative(long i,
Object value)
i - indexvalue - value to setClassCastException - if the type of value argument is different
than the type of the arraypublic void set_safe(long i,
Object value)
i - indexvalue - value to setpublic abstract void setBoolean(long i,
boolean value)
i - indexvalue - value to setpublic void setBoolean_safe(long i,
boolean value)
i - indexvalue - value to setpublic abstract void setByte(long i,
byte value)
i - indexvalue - value to setpublic void setByte_safe(long i,
byte value)
i - indexvalue - value to setpublic abstract void setUnsignedByte(long i,
short value)
i - indexvalue - value to setpublic void setUnsignedByte_safe(long i,
byte value)
i - indexvalue - value to setpublic abstract void setShort(long i,
short value)
i - indexvalue - value to setpublic void setShort_safe(long i,
short value)
i - indexvalue - value to setpublic abstract void setInt(long i,
int value)
i - indexvalue - value to setpublic void setInt_safe(long i,
int value)
i - indexvalue - value to setpublic abstract void setLong(long i,
long value)
i - indexvalue - value to setpublic void setLong_safe(long i,
long value)
i - indexvalue - value to setpublic abstract void setFloat(long i,
float value)
i - indexvalue - value to setpublic void setFloat_safe(long i,
float value)
i - indexvalue - value to setpublic abstract void setDouble(long i,
double value)
i - indexvalue - value to setpublic void setDouble_safe(long i,
double value)
i - indexvalue - value to setpublic boolean isLarge()
public boolean isNumeric()
public boolean isConstant()
public static void setMaxSizeOf32bitArray(int index)
index - the maximal size of a 32-bit array.public static int getMaxSizeOf32bitArray()
protected void zeroNativeMemory(long size)
size - the length of native memory blockCopyright © 2015. All rights reserved.