pl.edu.icm.jlargearrays
Class IntLargeArray
- java.lang.Object
-
- pl.edu.icm.jlargearrays.LargeArray
-
- pl.edu.icm.jlargearrays.IntLargeArray
-
- All Implemented Interfaces:
- java.io.Serializable
public class IntLargeArray extends LargeArray
An array of ints that can store up to 263 elements.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class pl.edu.icm.jlargearrays.LargeArray
DEFAULT_MAX_OBJECT_SIZE, DEFAULT_MAX_STRING_LENGTH, LARGEST_SUBARRAY
-
-
Constructor Summary
Constructors Constructor and Description IntLargeArray(int[] data)Creates new instance of this class.IntLargeArray(long length)Creates new instance of this class.IntLargeArray(long length, boolean zeroNativeMemory)Creates new instance of this class.IntLargeArray(long length, int initValue)Creates new instance of this classIntLargeArray(long length, int initValue, boolean createConstant)Creates new instance of this class
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description IntLargeArrayclone()Returns a deep copy of this instance.booleanequals(java.lang.Object o)Indicates whether some other object is "equal to" this one.java.lang.Integerget(long i)Returns a value at index i.booleangetBoolean(long i)Returns a boolean value at index i.boolean[]getBooleanData()If the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns boolean data.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.bytegetByte(long i)Returns a signed byte value at index i.byte[]getByteData()If the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns byte data.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.int[]getData()Returns a reference to the internal data array.doublegetDouble(long i)Returns a double value at index i.double[]getDoubleData()If the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns double data.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.floatgetFloat(long i)Returns a float value at index i.float[]getFloatData()If the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns float data.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.java.lang.IntegergetFromNative(long i)Returns a value at index i.intgetInt(long i)Returns an int value at index i.int[]getIntData()If the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns int data.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.longgetLong(long i)Returns a long value at index i.long[]getLongData()If the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns long data.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.shortgetShort(long i)Returns a short value at index i.short[]getShortData()If the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns short data.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.shortgetUnsignedByte(long i)Returns an unsigned byte value at index i.inthashCode(float quality)Generates an approximate hash code using a quality argument.voidsetBoolean(long i, boolean value)Sets a boolean value at index i.voidsetByte(long i, byte value)Sets a byte value at index i.voidsetDouble(long i, double value)Sets a double value at index i.voidsetFloat(long i, float value)Sets a float value at index i.voidsetInt(long i, int value)Sets an int value at index i.voidsetLong(long i, long value)Sets a long value at index i.voidsetShort(long i, short value)Sets a short value at index i.voidsetToNative(long i, java.lang.Object value)Sets a value at index i.voidsetUnsignedByte(long i, short value)Sets an unsigned byte value at index i.-
Methods inherited from class pl.edu.icm.jlargearrays.LargeArray
get_safe, getBoolean_safe, getByte_safe, getDouble_safe, getFloat_safe, getInt_safe, getLong_safe, getMaxSizeOf32bitArray, getShort_safe, getType, getUnsignedByte_safe, hashCode, isConstant, isLarge, isNumeric, length, nativePointer, set_safe, set, setBoolean_safe, setByte_safe, setDouble_safe, setFloat_safe, setInt_safe, setLong_safe, setMaxSizeOf32bitArray, setShort_safe, setUnsignedByte_safe
-
-
-
-
Constructor Detail
-
IntLargeArray
public IntLargeArray(long length)
Creates new instance of this class.- Parameters:
length- number of elements
-
IntLargeArray
public IntLargeArray(long length, boolean zeroNativeMemory)Creates new instance of this class.- Parameters:
length- number of elementszeroNativeMemory- if true, then the native memory is zeroed.
-
IntLargeArray
public IntLargeArray(long length, int initValue)Creates new instance of this class- Parameters:
length- number of elementsinitValue- initialization value
-
IntLargeArray
public IntLargeArray(long length, int initValue, boolean createConstant)Creates new instance of this class- Parameters:
length- number of elementsinitValue- initialization valuecreateConstant- if true, then a constant array is created
-
IntLargeArray
public IntLargeArray(int[] data)
Creates new instance of this class.- Parameters:
data- data array, this reference is used internally.
-
-
Method Detail
-
clone
public IntLargeArray clone()
Returns a deep copy of this instance. (The elements themselves are copied.)- Overrides:
clonein classLargeArray- Returns:
- a clone of this instance
-
hashCode
public int hashCode(float quality)
Description copied from class:LargeArrayGenerates an approximate hash code using a quality argument. For quality equal to 1 this method is equivalent to hashCode().- Overrides:
hashCodein classLargeArray- Parameters:
quality- a number between 0 and 1.- Returns:
- an approximate hash code
-
equals
public boolean equals(java.lang.Object o)
Description copied from class:LargeArrayIndicates whether some other object is "equal to" this one. Theequalsmethod implements "deep comparison": all properties are compared and all corresponding elements in both arrays are compared.- Specified by:
equalsin classLargeArray- Parameters:
o- the reference object with which to compare.- Returns:
trueif this object is the same as the o argument;falseotherwise.- See Also:
LargeArray.hashCode(),HashMap
-
get
public final java.lang.Integer get(long i)
Description copied from class:LargeArrayReturns a value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.- Specified by:
getin classLargeArray- Parameters:
i- an index- Returns:
- a value at index i.
-
getFromNative
public final java.lang.Integer getFromNative(long i)
Description copied from class:LargeArrayReturns a value at index i. Array bounds are not checked. If isLarge() returns false for a given array or the index argument is invalid, then calling this method will cause JVM crash.- Specified by:
getFromNativein classLargeArray- Parameters:
i- index- Returns:
- a value at index i. The type of returned value is the same as the type of this array.
-
getBoolean
public final boolean getBoolean(long i)
Description copied from class:LargeArrayReturns a boolean value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.- Specified by:
getBooleanin classLargeArray- Parameters:
i- an index- Returns:
- a boolean value at index i.
-
getByte
public final byte getByte(long i)
Description copied from class:LargeArrayReturns a signed byte value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.- Specified by:
getBytein classLargeArray- Parameters:
i- an index- Returns:
- a value at index i.
-
getUnsignedByte
public final short getUnsignedByte(long i)
Description copied from class:LargeArrayReturns an unsigned byte value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.- Specified by:
getUnsignedBytein classLargeArray- Parameters:
i- an index- Returns:
- a value at index i.
-
getShort
public final short getShort(long i)
Description copied from class:LargeArrayReturns a short value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.- Specified by:
getShortin classLargeArray- Parameters:
i- an index- Returns:
- a value at index i.
-
getInt
public final int getInt(long i)
Description copied from class:LargeArrayReturns an int value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.- Specified by:
getIntin classLargeArray- Parameters:
i- an index- Returns:
- a value at index i.
-
getLong
public final long getLong(long i)
Description copied from class:LargeArrayReturns a long value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.- Specified by:
getLongin classLargeArray- Parameters:
i- an index- Returns:
- a value at index i.
-
getFloat
public final float getFloat(long i)
Description copied from class:LargeArrayReturns a float value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.- Specified by:
getFloatin classLargeArray- Parameters:
i- an index- Returns:
- a value at index i.
-
getDouble
public final double getDouble(long i)
Description copied from class:LargeArrayReturns a double value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.- Specified by:
getDoublein classLargeArray- Parameters:
i- an index- Returns:
- a value at index i.
-
getData
public final int[] getData()
Description copied from class:LargeArrayReturns a reference to the internal data array. For constant arrays the length of the returned array is always equal to 1. If isLarge() returns true, then this method returns null.- Specified by:
getDatain classLargeArray- Returns:
- reference to the internal data array or null
-
getBooleanData
public final boolean[] getBooleanData()
Description copied from class:LargeArrayIf the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns boolean data. Otherwise, it returns null.- Specified by:
getBooleanDatain classLargeArray- Returns:
- an array containing the elements of this object or null
-
getBooleanData
public final boolean[] getBooleanData(boolean[] a, long startPos, long endPos, long step)Description copied from class:LargeArrayIf (endPos - startPos) / step is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns selected elements of this object. Otherwise, it returns null. If (endPos - startPos) / step is smaller or equal to a.length, it is returned therein. Otherwise, a new array is allocated and returned. Array bounds are checked.- Specified by:
getBooleanDatain classLargeArray- Parameters:
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 size- Returns:
- an array containing the elements of this object or null
-
getByteData
public final byte[] getByteData()
Description copied from class:LargeArrayIf the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns byte data. Otherwise, it returns null.- Specified by:
getByteDatain classLargeArray- Returns:
- an array containing the elements of this object or null
-
getByteData
public final byte[] getByteData(byte[] a, long startPos, long endPos, long step)Description copied from class:LargeArrayIf (endPos - startPos) / step is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns selected elements of this object. Otherwise, it returns null. If (endPos - startPos) / step is smaller or equal to a.length, it is returned therein. Otherwise, a new array is allocated and returned. Array bounds are checked.- Specified by:
getByteDatain classLargeArray- Parameters:
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 size- Returns:
- an array containing the elements of this object or null
-
getShortData
public final short[] getShortData()
Description copied from class:LargeArrayIf the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns short data. Otherwise, it returns null.- Specified by:
getShortDatain classLargeArray- Returns:
- an array containing the elements of this object or null
-
getShortData
public final short[] getShortData(short[] a, long startPos, long endPos, long step)Description copied from class:LargeArrayIf (endPos - startPos) / step is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns selected elements of this object. Otherwise, it returns null. If (endPos - startPos) / step is smaller or equal to a.length, it is returned therein. Otherwise, a new array is allocated and returned. Array bounds are checked.- Specified by:
getShortDatain classLargeArray- Parameters:
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 size- Returns:
- an array containing the elements of this object or null
-
getIntData
public final int[] getIntData()
Description copied from class:LargeArrayIf the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns int data. Otherwise, it returns null.- Specified by:
getIntDatain classLargeArray- Returns:
- an array containing the elements of this object or null
-
getIntData
public final int[] getIntData(int[] a, long startPos, long endPos, long step)Description copied from class:LargeArrayIf (endPos - startPos) / step is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns selected elements of this object. Otherwise, it returns null. If (endPos - startPos) / step is smaller or equal to a.length, it is returned therein. Otherwise, a new array is allocated and returned. Array bounds are checked.- Specified by:
getIntDatain classLargeArray- Parameters:
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 size- Returns:
- an array containing the elements of this object or null
-
getLongData
public final long[] getLongData()
Description copied from class:LargeArrayIf the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns long data. Otherwise, it returns null.- Specified by:
getLongDatain classLargeArray- Returns:
- an array containing the elements of this object or null
-
getLongData
public final long[] getLongData(long[] a, long startPos, long endPos, long step)Description copied from class:LargeArrayIf (endPos - startPos) / step is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns selected elements of this object. Otherwise, it returns null. If (endPos - startPos) / step is smaller or equal to a.length, it is returned therein. Otherwise, a new array is allocated and returned. Array bounds are checked.- Specified by:
getLongDatain classLargeArray- Parameters:
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 size- Returns:
- an array containing the elements of this object or null
-
getFloatData
public final float[] getFloatData()
Description copied from class:LargeArrayIf the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns float data. Otherwise, it returns null.- Specified by:
getFloatDatain classLargeArray- Returns:
- an array containing the elements of this object or null
-
getFloatData
public final float[] getFloatData(float[] a, long startPos, long endPos, long step)Description copied from class:LargeArrayIf (endPos - startPos) / step is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns selected elements of this object. Otherwise, it returns null. If (endPos - startPos) / step is smaller or equal to a.length, it is returned therein. Otherwise, a new array is allocated and returned. Array bounds are checked.- Specified by:
getFloatDatain classLargeArray- Parameters:
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 size- Returns:
- an array containing the elements of this object or null
-
getDoubleData
public final double[] getDoubleData()
Description copied from class:LargeArrayIf the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns double data. Otherwise, it returns null.- Specified by:
getDoubleDatain classLargeArray- Returns:
- an array containing the elements of this object or null
-
getDoubleData
public final double[] getDoubleData(double[] a, long startPos, long endPos, long step)Description copied from class:LargeArrayIf (endPos - startPos) / step is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns selected elements of this object. Otherwise, it returns null. If (endPos - startPos) / step is smaller or equal to a.length, it is returned therein. Otherwise, a new array is allocated and returned. Array bounds are checked.- Specified by:
getDoubleDatain classLargeArray- Parameters:
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 size- Returns:
- an array containing the elements of this object or null
-
setToNative
public final void setToNative(long i, java.lang.Object value)Description copied from class:LargeArraySets a value at index i. Array bounds are not checked. If isLarge() returns false for a given array or the index argument is invalid, then calling this method will cause JVM crash.- Specified by:
setToNativein classLargeArray- Parameters:
i- indexvalue- value to set
-
setBoolean
public final void setBoolean(long i, boolean value)Description copied from class:LargeArraySets a boolean value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.- Specified by:
setBooleanin classLargeArray- Parameters:
i- indexvalue- value to set
-
setByte
public final void setByte(long i, byte value)Description copied from class:LargeArraySets a byte value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.- Specified by:
setBytein classLargeArray- Parameters:
i- indexvalue- value to set
-
setUnsignedByte
public final void setUnsignedByte(long i, short value)Description copied from class:LargeArraySets an unsigned byte value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.- Specified by:
setUnsignedBytein classLargeArray- Parameters:
i- indexvalue- value to set
-
setShort
public final void setShort(long i, short value)Description copied from class:LargeArraySets a short value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.- Specified by:
setShortin classLargeArray- Parameters:
i- indexvalue- value to set
-
setInt
public final void setInt(long i, int value)Description copied from class:LargeArraySets an int value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.- Specified by:
setIntin classLargeArray- Parameters:
i- indexvalue- value to set
-
setLong
public final void setLong(long i, long value)Description copied from class:LargeArraySets a long value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.- Specified by:
setLongin classLargeArray- Parameters:
i- indexvalue- value to set
-
setFloat
public final void setFloat(long i, float value)Description copied from class:LargeArraySets a float value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.- Specified by:
setFloatin classLargeArray- Parameters:
i- indexvalue- value to set
-
setDouble
public final void setDouble(long i, double value)Description copied from class:LargeArraySets a double value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.- Specified by:
setDoublein classLargeArray- Parameters:
i- indexvalue- value to set
-
-
DataMelt 3.0 © DataMelt by jWork.ORG