Documentation of 'pl.edu.icm.jlargearrays.ByteLargeArray' Java class
ByteLargeArray
pl.edu.icm.jlargearrays

Class ByteLargeArray

  • All Implemented Interfaces:
    java.io.Serializable


    public class ByteLargeArray
    extends LargeArray
    An array of signed bytes [-128, 127] that can store up to 263 elements.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      ByteLargeArray(byte[] data)
      Creates new instance of this class.
      ByteLargeArray(long length)
      Creates new instance of this class.
      ByteLargeArray(long length, boolean zeroNativeMemory)
      Creates new instance of this class.
      ByteLargeArray(long length, byte initValue)
      Creates new instance of this class
      ByteLargeArray(long length, byte initValue, boolean createConstant)
      Creates new instance of this class
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      ByteLargeArray clone()
      Returns a deep copy of this instance.
      boolean equals(java.lang.Object o)
      Indicates whether some other object is "equal to" this one.
      java.lang.Byte get(long i)
      Returns a value at index i.
      boolean getBoolean(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.
      byte getByte(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.
      byte[] getData()
      Returns a reference to the internal data array.
      double getDouble(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.
      float getFloat(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.Byte getFromNative(long i)
      Returns a value at index i.
      int getInt(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.
      long getLong(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.
      short getShort(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.
      short getUnsignedByte(long i)
      Returns an unsigned byte value at index i.
      int hashCode(float quality)
      Generates an approximate hash code using a quality argument.
      void setBoolean(long i, boolean value)
      Sets a boolean value at index i.
      void setByte(long i, byte value)
      Sets a byte value at index i.
      void setDouble(long i, double value)
      Sets a double value at index i.
      void setFloat(long i, float value)
      Sets a float value at index i.
      void setInt(long i, int value)
      Sets an int value at index i.
      void setLong(long i, long value)
      Sets a long value at index i.
      void setShort(long i, short value)
      Sets a short value at index i.
      void setToNative(long i, java.lang.Object value)
      Sets a value at index i.
      void setUnsignedByte(long i, short value)
      Sets an unsigned byte value at index i.
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ByteLargeArray

        public ByteLargeArray(long length)
        Creates new instance of this class.
        Parameters:
        length - number of elements
      • ByteLargeArray

        public ByteLargeArray(long length,
                              boolean zeroNativeMemory)
        Creates new instance of this class.
        Parameters:
        length - number of elements
        zeroNativeMemory - if true, then the native memory is zeroed.
      • ByteLargeArray

        public ByteLargeArray(long length,
                              byte initValue)
        Creates new instance of this class

        Parameters:
        length - number of elements
        initValue - initialization value
      • ByteLargeArray

        public ByteLargeArray(long length,
                              byte initValue,
                              boolean createConstant)
        Creates new instance of this class

        Parameters:
        length - number of elements
        initValue - initialization value
        createConstant - if true, then a constant array is created
      • ByteLargeArray

        public ByteLargeArray(byte[] data)
        Creates new instance of this class.
        Parameters:
        data - data array, this reference is used internally.
    • Method Detail

      • clone

        public ByteLargeArray clone()
        Returns a deep copy of this instance. (The elements themselves are copied.)
        Overrides:
        clone in class LargeArray
        Returns:
        a clone of this instance
      • hashCode

        public int hashCode(float quality)
        Description copied from class: LargeArray
        Generates an approximate hash code using a quality argument. For quality equal to 1 this method is equivalent to hashCode().
        Overrides:
        hashCode in class LargeArray
        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: LargeArray
        Indicates whether some other object is "equal to" this one. The equals method implements "deep comparison": all properties are compared and all corresponding elements in both arrays are compared.
        Specified by:
        equals in class LargeArray
        Parameters:
        o - the reference object with which to compare.
        Returns:
        true if this object is the same as the o argument; false otherwise.
        See Also:
        LargeArray.hashCode(), HashMap
      • get

        public final java.lang.Byte get(long i)
        Description copied from class: LargeArray
        Returns a value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.
        Specified by:
        get in class LargeArray
        Parameters:
        i - an index
        Returns:
        a value at index i.
      • getFromNative

        public final java.lang.Byte getFromNative(long i)
        Description copied from class: LargeArray
        Returns 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:
        getFromNative in class LargeArray
        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: LargeArray
        Returns a boolean value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.
        Specified by:
        getBoolean in class LargeArray
        Parameters:
        i - an index
        Returns:
        a boolean value at index i.
      • getByte

        public final byte getByte(long i)
        Description copied from class: LargeArray
        Returns 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:
        getByte in class LargeArray
        Parameters:
        i - an index
        Returns:
        a value at index i.
      • getUnsignedByte

        public final short getUnsignedByte(long i)
        Description copied from class: LargeArray
        Returns 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:
        getUnsignedByte in class LargeArray
        Parameters:
        i - an index
        Returns:
        a value at index i.
      • getShort

        public final short getShort(long i)
        Description copied from class: LargeArray
        Returns a short value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.
        Specified by:
        getShort in class LargeArray
        Parameters:
        i - an index
        Returns:
        a value at index i.
      • getInt

        public final int getInt(long i)
        Description copied from class: LargeArray
        Returns an int value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.
        Specified by:
        getInt in class LargeArray
        Parameters:
        i - an index
        Returns:
        a value at index i.
      • getLong

        public final long getLong(long i)
        Description copied from class: LargeArray
        Returns a long value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.
        Specified by:
        getLong in class LargeArray
        Parameters:
        i - an index
        Returns:
        a value at index i.
      • getFloat

        public final float getFloat(long i)
        Description copied from class: LargeArray
        Returns a float value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.
        Specified by:
        getFloat in class LargeArray
        Parameters:
        i - an index
        Returns:
        a value at index i.
      • getDouble

        public final double getDouble(long i)
        Description copied from class: LargeArray
        Returns a double value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.
        Specified by:
        getDouble in class LargeArray
        Parameters:
        i - an index
        Returns:
        a value at index i.
      • getBooleanData

        public final boolean[] getBooleanData(boolean[] a,
                                              long startPos,
                                              long endPos,
                                              long step)
        Description copied from class: LargeArray
        If (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:
        getBooleanData in class LargeArray
        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
      • getBooleanData

        public final boolean[] getBooleanData()
        Description copied from class: LargeArray
        If the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns boolean data. Otherwise, it returns null.
        Specified by:
        getBooleanData in class LargeArray
        Returns:
        an array containing the elements of this object or null
      • getData

        public final byte[] getData()
        Description copied from class: LargeArray
        Returns 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:
        getData in class LargeArray
        Returns:
        reference to the internal data array or null
      • getByteData

        public final byte[] getByteData()
        Description copied from class: LargeArray
        If the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns byte data. Otherwise, it returns null.
        Specified by:
        getByteData in class LargeArray
        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: LargeArray
        If (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:
        getByteData in class LargeArray
        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: LargeArray
        If the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns short data. Otherwise, it returns null.
        Specified by:
        getShortData in class LargeArray
        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: LargeArray
        If (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:
        getShortData in class LargeArray
        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: LargeArray
        If the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns int data. Otherwise, it returns null.
        Specified by:
        getIntData in class LargeArray
        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: LargeArray
        If (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:
        getIntData in class LargeArray
        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: LargeArray
        If the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns long data. Otherwise, it returns null.
        Specified by:
        getLongData in class LargeArray
        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: LargeArray
        If (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:
        getLongData in class LargeArray
        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: LargeArray
        If the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns float data. Otherwise, it returns null.
        Specified by:
        getFloatData in class LargeArray
        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: LargeArray
        If (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:
        getFloatData in class LargeArray
        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: LargeArray
        If the size of the array is smaller than LargeArray.LARGEST_SUBARRAY, then this method returns double data. Otherwise, it returns null.
        Specified by:
        getDoubleData in class LargeArray
        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: LargeArray
        If (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:
        getDoubleData in class LargeArray
        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: LargeArray
        Sets 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:
        setToNative in class LargeArray
        Parameters:
        i - index
        value - value to set
      • setBoolean

        public final void setBoolean(long i,
                                     boolean value)
        Description copied from class: LargeArray
        Sets a boolean value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.
        Specified by:
        setBoolean in class LargeArray
        Parameters:
        i - index
        value - value to set
      • setByte

        public final void setByte(long i,
                                  byte value)
        Description copied from class: LargeArray
        Sets a byte value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.
        Specified by:
        setByte in class LargeArray
        Parameters:
        i - index
        value - value to set
      • setUnsignedByte

        public final void setUnsignedByte(long i,
                                          short value)
        Description copied from class: LargeArray
        Sets 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:
        setUnsignedByte in class LargeArray
        Parameters:
        i - index
        value - value to set
      • setShort

        public final void setShort(long i,
                                   short value)
        Description copied from class: LargeArray
        Sets a short value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.
        Specified by:
        setShort in class LargeArray
        Parameters:
        i - index
        value - value to set
      • setInt

        public final void setInt(long i,
                                 int value)
        Description copied from class: LargeArray
        Sets an int value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.
        Specified by:
        setInt in class LargeArray
        Parameters:
        i - index
        value - value to set
      • setLong

        public final void setLong(long i,
                                  long value)
        Description copied from class: LargeArray
        Sets a long value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.
        Specified by:
        setLong in class LargeArray
        Parameters:
        i - index
        value - value to set
      • setFloat

        public final void setFloat(long i,
                                   float value)
        Description copied from class: LargeArray
        Sets a float value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.
        Specified by:
        setFloat in class LargeArray
        Parameters:
        i - index
        value - value to set
      • setDouble

        public final void setDouble(long i,
                                    double value)
        Description copied from class: LargeArray
        Sets a double value at index i. Array bounds are not checked. Calling this method with invalid index argument will cause JVM crash.
        Specified by:
        setDouble in class LargeArray
        Parameters:
        i - index
        value - value to set

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.