Package ucar.ma2
Class ArrayScalar
- java.lang.Object
-
- ucar.ma2.Array
-
- ucar.ma2.ArrayScalar
-
@Immutable public class ArrayScalar extends Array
Helper class for StructureDataAscii
-
-
Constructor Summary
Constructors Constructor Description ArrayScalar(Object value, boolean isUnsigned)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcopyFrom1DJavaArray(IndexIterator iter, Object javaArray)protected voidcopyTo1DJavaArray(IndexIterator iter, Object javaArray)protected ArraycreateView(Index index)create new Array with given Index and the same backing storebooleangetBoolean(int elem)booleangetBoolean(Index ima)Get the array element at the current element of ima, as a boolean.bytegetByte(int elem)bytegetByte(Index ima)Get the array element at the current element of ima, as a byte.chargetChar(int elem)chargetChar(Index ima)Get the array element at the current element of ima, as a char.doublegetDouble(int elem)doublegetDouble(Index ima)Get the array element at the current element of ima, as a double.ClassgetElementType()Get the element class type of this ArrayfloatgetFloat(int elem)floatgetFloat(Index ima)Get the array element at the current element of ima, as a float.intgetInt(int elem)intgetInt(Index ima)Get the array element at the current element of ima, as a int.longgetLong(int elem)longgetLong(Index ima)Get the array element at the current element of ima, as a long.ObjectgetObject(int elem)ObjectgetObject(Index ima)Get the array element at index as an Object.shortgetShort(int elem)shortgetShort(Index ima)Get the array element at the current element of ima, as a short.ObjectgetStorage()Get underlying primitive array storage.voidsetBoolean(int elem, boolean value)voidsetBoolean(Index ima, boolean value)Set the array element at the current element of ima.voidsetByte(int elem, byte value)voidsetByte(Index ima, byte value)Set the array element at the current element of ima.voidsetChar(int elem, char value)voidsetChar(Index ima, char value)Set the array element at the current element of ima.voidsetDouble(int elem, double val)voidsetDouble(Index ima, double value)Set the array element at the current element of ima.voidsetFloat(int elem, float val)voidsetFloat(Index ima, float value)Set the array element at the current element of ima.voidsetInt(int elem, int value)voidsetInt(Index ima, int value)Set the array element at the current element of ima.voidsetLong(int elem, long value)voidsetLong(Index ima, long value)Set the array element at the current element of ima.voidsetObject(int elem, Object value)voidsetObject(Index ima, Object value)Set the array element at index to the specified value.voidsetShort(int elem, short value)voidsetShort(Index ima, short value)Set the array element at the current element of ima.-
Methods inherited from class ucar.ma2.Array
arraycopy, copy, copyTo1DJavaArray, copyToNDJavaArray, factory, factory, factory, factory, factoryConstant, factoryCopy, flip, get1DJavaArray, get1DJavaArray, getDataAsByteBuffer, 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 Detail
-
ArrayScalar
public ArrayScalar(Object value, boolean isUnsigned)
-
-
Method Detail
-
getElementType
public Class getElementType()
Description copied from class:ArrayGet the element class type of this Array- Specified by:
getElementTypein classArray- Returns:
- the class of the element
-
createView
protected Array createView(Index index)
Description copied from class:Arraycreate new Array with given Index and the same backing store- Specified by:
createViewin classArray- Parameters:
index- use this Index- Returns:
- a view of the Array using the given Index
-
getStorage
public Object 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
-
copyFrom1DJavaArray
protected void copyFrom1DJavaArray(IndexIterator iter, Object javaArray)
- Specified by:
copyFrom1DJavaArrayin classArray
-
copyTo1DJavaArray
protected void copyTo1DJavaArray(IndexIterator iter, Object javaArray)
- Specified by:
copyTo1DJavaArrayin classArray
-
getDouble
public double getDouble(Index ima)
Description copied from class:ArrayGet the array element at the current element of ima, as a double.
-
setDouble
public void setDouble(Index ima, double value)
Description copied from class:ArraySet the array element at the current element of ima.
-
getFloat
public float getFloat(Index ima)
Description copied from class:ArrayGet the array element at the current element of ima, as a float.
-
setFloat
public void setFloat(Index ima, float value)
Description copied from class:ArraySet the array element at the current element of ima.
-
getLong
public long getLong(Index ima)
Description copied from class:ArrayGet the array element at the current element of ima, as a long.
-
setLong
public void setLong(Index ima, long value)
Description copied from class:ArraySet the array element at the current element of ima.
-
getInt
public int getInt(Index ima)
Description copied from class:ArrayGet the array element at the current element of ima, as a int.
-
setInt
public void setInt(Index ima, int value)
Description copied from class:ArraySet the array element at the current element of ima.
-
getShort
public short getShort(Index ima)
Description copied from class:ArrayGet the array element at the current element of ima, as a short.
-
setShort
public void setShort(Index ima, short value)
Description copied from class:ArraySet the array element at the current element of ima.
-
getByte
public byte getByte(Index ima)
Description copied from class:ArrayGet the array element at the current element of ima, as a byte.
-
setByte
public void setByte(Index ima, byte value)
Description copied from class:ArraySet the array element at the current element of ima.
-
getChar
public char getChar(Index ima)
Description copied from class:ArrayGet the array element at the current element of ima, as a char.
-
setChar
public void setChar(Index ima, char value)
Description copied from class:ArraySet the array element at the current element of ima.
-
getBoolean
public boolean getBoolean(Index ima)
Description copied from class:ArrayGet the array element at the current element of ima, as a boolean.- Specified by:
getBooleanin classArray- Parameters:
ima- Index with current element set- Returns:
- value at
indexcast to boolean if necessary.
-
setBoolean
public void setBoolean(Index ima, boolean value)
Description copied from class:ArraySet the array element at the current element of ima.- Specified by:
setBooleanin classArray- Parameters:
ima- Index with current element setvalue- the new value; cast to underlying data type if necessary.
-
getObject
public Object getObject(Index ima)
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
public void setObject(Index ima, Object value)
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)
-
getBoolean
public boolean getBoolean(int elem)
- Specified by:
getBooleanin classArray
-
setBoolean
public void setBoolean(int elem, boolean value)- Specified by:
setBooleanin classArray
-
-