类 ArrayChar

    • 字段详细资料

      • storage

        protected char[] storage
    • 构造器详细资料

      • ArrayChar

        public ArrayChar​(int[] dimensions)
        Create a new Array of type char and the given shape. dimensions.length determines the rank of the new Array.
        参数:
        dimensions - the shape of the Array.
      • ArrayChar

        public ArrayChar​(java.lang.String s)
    • 方法详细资料

      • createView

        protected Array createView​(Index index)
        create new Array with given indexImpl and same backing store
        指定者:
        createView 在类中 Array
        参数:
        index - use this Index
        返回:
        a view of the Array using the given Index
      • getStorage

        public java.lang.Object getStorage()
        从类复制的说明: Array
        Get underlying primitive array storage. Exposed for efficiency, use at your own risk.
        指定者:
        getStorage 在类中 Array
        返回:
        underlying primitive array storage
      • getDataAsByteBuffer

        public java.nio.ByteBuffer getDataAsByteBuffer()
        Trasfer data to a ByteBuffer. Note we cast char to byte, discarding top byte, if any. This is because CDM char is really a byte, not a java char.
        覆盖:
        getDataAsByteBuffer 在类中 Array
        返回:
        data in a ByteBuffer
      • getElementType

        public java.lang.Class getElementType()
        Return the element class type
        指定者:
        getElementType 在类中 Array
        返回:
        the class of the element
      • get

        public char get​(Index i)
        get the value at the specified index.
      • set

        public void set​(Index i,
                        char value)
        set the value at the sepcified index.
      • getDouble

        public double getDouble​(Index i)
        从类复制的说明: Array
        Get the array element at the current element of ima, as a double.
        指定者:
        getDouble 在类中 Array
        参数:
        i - Index with current element set
        返回:
        value at index cast to double if necessary.
      • setDouble

        public void setDouble​(Index i,
                              double value)
        从类复制的说明: Array
        Set the array element at the current element of ima.
        指定者:
        setDouble 在类中 Array
        参数:
        i - Index with current element set
        value - the new value; cast to underlying data type if necessary.
      • getFloat

        public float getFloat​(Index i)
        从类复制的说明: Array
        Get the array element at the current element of ima, as a float.
        指定者:
        getFloat 在类中 Array
        参数:
        i - Index with current element set
        返回:
        value at index cast to float if necessary.
      • setFloat

        public void setFloat​(Index i,
                             float value)
        从类复制的说明: Array
        Set the array element at the current element of ima.
        指定者:
        setFloat 在类中 Array
        参数:
        i - Index with current element set
        value - the new value; cast to underlying data type if necessary.
      • getLong

        public long getLong​(Index i)
        从类复制的说明: Array
        Get the array element at the current element of ima, as a long.
        指定者:
        getLong 在类中 Array
        参数:
        i - Index with current element set
        返回:
        value at index cast to long if necessary.
      • setLong

        public void setLong​(Index i,
                            long value)
        从类复制的说明: Array
        Set the array element at the current element of ima.
        指定者:
        setLong 在类中 Array
        参数:
        i - Index with current element set
        value - the new value; cast to underlying data type if necessary.
      • getInt

        public int getInt​(Index i)
        从类复制的说明: Array
        Get the array element at the current element of ima, as a int.
        指定者:
        getInt 在类中 Array
        参数:
        i - Index with current element set
        返回:
        value at index cast to int if necessary.
      • setInt

        public void setInt​(Index i,
                           int value)
        从类复制的说明: Array
        Set the array element at the current element of ima.
        指定者:
        setInt 在类中 Array
        参数:
        i - Index with current element set
        value - the new value; cast to underlying data type if necessary.
      • getShort

        public short getShort​(Index i)
        从类复制的说明: Array
        Get the array element at the current element of ima, as a short.
        指定者:
        getShort 在类中 Array
        参数:
        i - Index with current element set
        返回:
        value at index cast to short if necessary.
      • setShort

        public void setShort​(Index i,
                             short value)
        从类复制的说明: Array
        Set the array element at the current element of ima.
        指定者:
        setShort 在类中 Array
        参数:
        i - Index with current element set
        value - the new value; cast to underlying data type if necessary.
      • getByte

        public byte getByte​(Index i)
        从类复制的说明: Array
        Get the array element at the current element of ima, as a byte.
        指定者:
        getByte 在类中 Array
        参数:
        i - Index with current element set
        返回:
        value at index cast to float if necessary.
      • setByte

        public void setByte​(Index i,
                            byte value)
        从类复制的说明: Array
        Set the array element at the current element of ima.
        指定者:
        setByte 在类中 Array
        参数:
        i - Index with current element set
        value - the new value; cast to underlying data type if necessary.
      • getChar

        public char getChar​(Index i)
        从类复制的说明: Array
        Get the array element at the current element of ima, as a char.
        指定者:
        getChar 在类中 Array
        参数:
        i - Index with current element set
        返回:
        value at index cast to char if necessary.
      • setChar

        public void setChar​(Index i,
                            char value)
        从类复制的说明: Array
        Set the array element at the current element of ima.
        指定者:
        setChar 在类中 Array
        参数:
        i - Index with current element set
        value - the new value; cast to underlying data type if necessary.
      • getBoolean

        public boolean getBoolean​(Index i)
        not legal, throw ForbiddenConversionException
        指定者:
        getBoolean 在类中 Array
        参数:
        i - Index with current element set
        返回:
        value at index cast to boolean if necessary.
      • setBoolean

        public void setBoolean​(Index i,
                               boolean value)
        not legal, throw ForbiddenConversionException
        指定者:
        setBoolean 在类中 Array
        参数:
        i - Index with current element set
        value - the new value; cast to underlying data type if necessary.
      • getComplex

        public Complex getComplex​(Index i)
        not legal, throw ForbiddenConversionException
        指定者:
        getComplex 在类中 Array
        参数:
        i - Index with current element set
        返回:
        value at index cast to boolean if necessary.
      • setComplex

        public void setComplex​(Index i,
                               Complex value)
        not legal, throw ForbiddenConversionException
        指定者:
        setComplex 在类中 Array
        参数:
        i - Index with current element set
        value - the new value; cast to underlying data type if necessary.
      • getObject

        public java.lang.Object getObject​(Index i)
        从类复制的说明: Array
        Get the array element at index as an Object. The returned value is wrapped in an object, eg Double for double
        指定者:
        getObject 在类中 Array
        参数:
        i - element Index
        返回:
        Object value at index
      • setObject

        public void setObject​(Index i,
                              java.lang.Object value)
        从类复制的说明: Array
        Set the array element at index to the specified value. the value must be passed wrapped in the appropriate Object (eg Double for double)
        指定者:
        setObject 在类中 Array
        参数:
        i - Index with current element set
        value - the new value.
      • getString

        public java.lang.String getString()
        Create a String out of this rank one ArrayChar object. If there is a null (0) value in the ArrayChar array, the String will end there. The null is not returned as part of the String.
        返回:
        String value of CharArray
        抛出:
        java.lang.IllegalArgumentException - if rank != 1
      • getString

        public java.lang.String getString​(int index)
        Create a String out of this rank two ArrayChar object. This treats the ArrayChar as a 1D array of Strings. If there is a null (0) value in the ArrayChar array, the String will end there. The null is not returned as part of the String.
        指定者:
        getString 在类中 Array
        参数:
        index - index into 1D String array, must be < getShape(0). @return String value
        抛出:
        java.lang.IllegalArgumentException - if rank != 2
      • getString

        public java.lang.String getString​(Index ima)
        Create a String out of this ArrayChar object. The rank must be 1 or greater. If there is a null (0) value in the ArrayChar array, the String will end there. The null is not returned as part of the String.

        If rank=1, then this will make a string out of the entire CharArray, ignoring ima. If rank is greater than 1, then make a String out of the characters of the last dimension, indexed by ima. This method treats the CharArray like an array of Strings, and allows you to iterate over them, eg for a 2D ArrayChar:

        ArrayChar ca; Index ima = ca.getIndex(); for (int i=0; i

        指定者:
        getString 在类中 Array
        参数:
        ima - the Index of where in the Array to start.
        返回:
        String value of CharArray
        抛出:
        java.lang.IllegalArgumentException - if rank != 1
      • setString

        public void setString​(java.lang.String val)
        Set the ArrayChar values from the characters in the String. Rank must be 1. If String longer than ArrayChar, ignore extra chars; if shorter, fill with 0.
        参数:
        val - set characters from this String
        抛出:
        java.lang.IllegalArgumentException - if rank != 2
      • setString

        public void setString​(int index,
                              java.lang.String val)
        Set the ArrayChar values from the characters in the String. Rank must be 2. This treats the ArrayChar as a 1D array of Strings. If String val longer than ArrayChar, ignore extra chars; if shorter, fill with 0.

        String[] val = new String[n]; ArrayChar ca; Index ima = ca.getIndex(); for (int i=0; i

        指定者:
        setString 在类中 Array
        参数:
        index - index into 1D String array, must be < getShape(0). @param v al set chars from this sString
      • setString

        public void setString​(Index ima,
                              java.lang.String val)
        Set the ArrayChar values from the characters in the String. Rank must be 1 or greater. If String longer than ArrayChar, ignore extra chars; if shorter, fill with 0. If rank 1, set entire ArrayChar, ignoring ima. If rank > 1, treat the ArrayChar like an array of Strings of rank-1, and set the row indexed by ima. For example, rank 3:

        String[][] val; ArrayChar ca; Index ima = ca.getIndex(); int rank0 = ca.getShape()[0]; int rank1 = ca.getShape()[1];

        for (int i=0; i

        指定者:
        setString 在类中 Array
        参数:
        ima - the Index of where in the Array to start.
        val - set to this value
      • getDouble

        public double getDouble​(int index)
        指定者:
        getDouble 在类中 Array
      • setDouble

        public void setDouble​(int index,
                              double value)
        指定者:
        setDouble 在类中 Array
      • getFloat

        public float getFloat​(int index)
        指定者:
        getFloat 在类中 Array
      • setFloat

        public void setFloat​(int index,
                             float value)
        指定者:
        setFloat 在类中 Array
      • getLong

        public long getLong​(int index)
        指定者:
        getLong 在类中 Array
      • setLong

        public void setLong​(int index,
                            long value)
        指定者:
        setLong 在类中 Array
      • getInt

        public int getInt​(int index)
        指定者:
        getInt 在类中 Array
      • setInt

        public void setInt​(int index,
                           int value)
        指定者:
        setInt 在类中 Array
      • getShort

        public short getShort​(int index)
        指定者:
        getShort 在类中 Array
      • setShort

        public void setShort​(int index,
                             short value)
        指定者:
        setShort 在类中 Array
      • getByte

        public byte getByte​(int index)
        指定者:
        getByte 在类中 Array
      • setByte

        public void setByte​(int index,
                            byte value)
        指定者:
        setByte 在类中 Array
      • getChar

        public char getChar​(int index)
        指定者:
        getChar 在类中 Array
      • setChar

        public void setChar​(int index,
                            char value)
        指定者:
        setChar 在类中 Array
      • getBoolean

        public boolean getBoolean​(int index)
        指定者:
        getBoolean 在类中 Array
      • setBoolean

        public void setBoolean​(int index,
                               boolean value)
        指定者:
        setBoolean 在类中 Array
      • getObject

        public java.lang.Object getObject​(int index)
        指定者:
        getObject 在类中 Array
      • setObject

        public void setObject​(int index,
                              java.lang.Object value)
        指定者:
        setObject 在类中 Array
      • toString

        public java.lang.String toString()
        覆盖:
        toString 在类中 Array
      • getStringIterator

        public ArrayChar.StringIterator getStringIterator()
        Treat this Variable as an array of Strings, and iterate over all the strings in the array. If rank == 0, will make single String of length 1.
        返回:
        Iterator over Strings.
      • make1DStringArray

        public ArrayObject make1DStringArray()
        Make this into the equivilent 1D ArrayObject of Strings.
        返回:
        1D ArrayObject of Strings
      • makeFromString

        public static ArrayChar makeFromString​(java.lang.String s,
                                               int max)
        Create an ArrayChar from a String
        参数:
        s - String
        max - maximum length
        返回:
        equivilent ArrayChar
      • makeFromStringArray

        public static ArrayChar makeFromStringArray​(ArrayObject values)
        Create an ArrayChar from an ArrayObject of Strings.
        参数:
        values - ArrayObject of String
        返回:
        equivilent ArrayChar, using maximum length of String. Unused are zero filled.
      • makeFromStringArray

        public static ArrayChar makeFromStringArray​(ArrayObject values,
                                                    int strlen)
        Create an ArrayChar from an ArrayObject of Strings. Inverse of make1DStringArray. Copies the data.
        参数:
        values - ArrayObject of String
        strlen - string length dimension size
        返回:
        equivilent ArrayChar. Unused are zero filled.