Package ucar.ma2
Class ArrayString
java.lang.Object
ucar.ma2.Array
ucar.ma2.ArrayString
- Direct Known Subclasses:
ArrayString.D0,ArrayString.D1,ArrayString.D2,ArrayString.D3,ArrayString.D4,ArrayString.D5,ArrayString.D6,ArrayString.D7
Concrete implementation of Array specialized for Strings.
Data storage is with 1D java array of Strings.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classConcrete implementation of Array specialized for String, rank 0.static classConcrete implementation of Array specialized for Strings, rank 1.static classConcrete implementation of Array specialized for Strings, rank 2.static classConcrete implementation of Array specialized for Strings, rank 3.static classConcrete implementation of Array specialized for Strings, rank 4.static classConcrete implementation of Array specialized for Strings, rank 5.static classConcrete implementation of Array specialized for Strings, rank 6.static classConcrete implementation of Array specialized for Strings, rank 7. -
Constructor Summary
ConstructorsConstructorDescriptionArrayString(int[] dimensions) Create a new Array of type long and the given shape. -
Method Summary
Modifier and TypeMethodDescriptionget the value at the specified index.booleangetBoolean(int index) booleangetBoolean(Index i) not legal, throw ForbiddenConversionExceptionbytegetByte(int index) bytenot legal, throw ForbiddenConversionExceptionchargetChar(int index) charnot legal, throw ForbiddenConversionExceptionThis gets the data as a ByteBuffer, in correct order.doublegetDouble(int index) doublenot legal, throw ForbiddenConversionExceptionReturn the element class typefloatgetFloat(int index) floatnot legal, throw ForbiddenConversionExceptionintgetInt(int index) intnot legal, throw ForbiddenConversionExceptionlonggetLong(int index) longnot legal, throw ForbiddenConversionExceptiongetObject(int index) Get the array element at index as an Object.shortgetShort(int index) shortnot legal, throw ForbiddenConversionExceptionGet underlying primitive array storage.voidset the value at the sepcified index.voidsetBoolean(int index, boolean value) voidsetBoolean(Index i, boolean value) not legal, throw ForbiddenConversionExceptionvoidsetByte(int index, byte value) voidnot legal, throw ForbiddenConversionExceptionvoidsetChar(int index, char value) voidnot legal, throw ForbiddenConversionExceptionvoidsetDouble(int index, double value) voidnot legal, throw ForbiddenConversionExceptionvoidsetFloat(int index, float value) voidnot legal, throw ForbiddenConversionExceptionvoidsetInt(int index, int value) voidnot legal, throw ForbiddenConversionExceptionvoidsetLong(int index, long value) voidnot legal, throw ForbiddenConversionExceptionvoidvoidSet the array element at index to the specified value.voidsetShort(int index, short value) voidnot legal, throw ForbiddenConversionExceptionMethods inherited from class ucar.ma2.Array
arraycopy, copy, copyTo1DJavaArray, copyToNDJavaArray, factory, factory, factory, factory, factoryConstant, factoryCopy, flip, get1DJavaArray, get1DJavaArray, getDataAsByteBuffer, getDataAsByteBuffer, getDataType, getIndex, getIndexIterator, getRangeIterator, getRank, getShape, getSize, getSizeBytes, hasNext, isConstant, isUnsigned, isVlen, makeArray, makeArray, makeArray, makeArrayRankPlusOne, makeFromJavaArray, makeFromJavaArray, makeObjectArray, makeVlenArray, next, nextBoolean, nextByte, nextChar, nextDouble, nextFloat, nextInt, nextLong, nextShort, permute, reduce, reduce, resetLocalIterator, reshape, reshapeNoCopy, section, section, section, sectionNoReduce, sectionNoReduce, shapeToString, slice, toString, transpose
-
Constructor Details
-
ArrayString
public ArrayString(int[] dimensions) Create a new Array of type long and the given shape. dimensions.length determines the rank of the new Array.- Parameters:
dimensions- the shape of the Array.
-
-
Method Details
-
getStorage
Description copied from class:ArrayGet underlying primitive array storage. Exposed for efficiency, use at your own risk.- Specified by:
getStoragein classArray- Returns:
- underlying primitive array storage
-
getDataAsByteBuffer
Description copied from class:ArrayThis gets the data as a ByteBuffer, in correct order. It avoids copying if possible. Only for numeric types (byte, short, int, long, double, float)- Overrides:
getDataAsByteBufferin classArray- Returns:
- equivalent data in a ByteBuffer
-
getElementType
Return the element class type- Specified by:
getElementTypein classArray- Returns:
- the class of the element
-
get
get the value at the specified index. -
set
set the value at the sepcified index. -
getDouble
not legal, throw ForbiddenConversionException -
setDouble
not legal, throw ForbiddenConversionException -
getFloat
not legal, throw ForbiddenConversionException -
setFloat
not legal, throw ForbiddenConversionException -
getLong
not legal, throw ForbiddenConversionException -
setLong
not legal, throw ForbiddenConversionException -
getInt
not legal, throw ForbiddenConversionException -
setInt
not legal, throw ForbiddenConversionException -
getShort
not legal, throw ForbiddenConversionException -
setShort
not legal, throw ForbiddenConversionException -
getByte
not legal, throw ForbiddenConversionException -
setByte
not legal, throw ForbiddenConversionException -
getBoolean
not legal, throw ForbiddenConversionException- Specified by:
getBooleanin classArray- Parameters:
i- Index with current element set- Returns:
- value at
indexcast to boolean if necessary.
-
setBoolean
not legal, throw ForbiddenConversionException- Specified by:
setBooleanin classArray- Parameters:
i- Index with current element setvalue- the new value; cast to underlying data type if necessary.
-
getChar
not legal, throw ForbiddenConversionException -
setChar
not legal, throw ForbiddenConversionException -
getObject
Description copied from class:ArrayGet the array element at index as an Object. The returned value is wrapped in an object, eg Double for double -
setObject
Description copied from class:ArraySet the array element at index to the specified value. the value must be passed wrapped in the appropriate Object (eg Double for double) -
getDouble
public double getDouble(int index) -
setDouble
public void setDouble(int index, double value) -
getFloat
public float getFloat(int index) -
setFloat
public void setFloat(int index, float value) -
getLong
public long getLong(int index) -
setLong
public void setLong(int index, long value) -
getInt
public int getInt(int index) -
setInt
public void setInt(int index, int value) -
getShort
public short getShort(int index) -
setShort
public void setShort(int index, short value) -
getByte
public byte getByte(int index) -
setByte
public void setByte(int index, byte value) -
getChar
public char getChar(int index) -
setChar
public void setChar(int index, char value) -
getBoolean
public boolean getBoolean(int index) - Specified by:
getBooleanin classArray
-
setBoolean
public void setBoolean(int index, boolean value) - Specified by:
setBooleanin classArray
-
getObject
-
setObject
-