Package ucar.ma2
Class ArrayFloat
java.lang.Object
ucar.ma2.Array
ucar.ma2.ArrayFloat
- Direct Known Subclasses:
ArrayFloat.D0,ArrayFloat.D1,ArrayFloat.D2,ArrayFloat.D3,ArrayFloat.D4,ArrayFloat.D5,ArrayFloat.D6,ArrayFloat.D7
Concrete implementation of Array specialized for floats.
Data storage is with 1D java array of floats.
issues: what should we do if a conversion loses accuracy? nothing ? Exception ?
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classConcrete implementation of Array specialized for floats, rank 0.static classConcrete implementation of Array specialized for floats, rank 1.static classConcrete implementation of Array specialized for floats, rank 2.static classConcrete implementation of Array specialized for floats, rank 3.static classConcrete implementation of Array specialized for floats, rank 4.static classConcrete implementation of Array specialized for floats, rank 5.static classConcrete implementation of Array specialized for floats, rank 6.static classConcrete implementation of Array specialized for floats, rank 7. -
Constructor Summary
ConstructorsConstructorDescriptionArrayFloat(int[] dimensions) Create a new Array of type float and the given shape. -
Method Summary
Modifier and TypeMethodDescriptionfloatget the value at the specified index.booleangetBoolean(int index) booleangetBoolean(Index i) not legal, throw ForbiddenConversionExceptionbytegetByte(int index) byteGet the array element at the current element of ima, as a byte.chargetChar(int index) charGet the array element at the current element of ima, as a char.This gets the data as a ByteBuffer, in correct order.doublegetDouble(int index) doubleGet the array element at the current element of ima, as a double.Return the element class typefloatgetFloat(int index) floatGet the array element at the current element of ima, as a float.intgetInt(int index) intGet the array element at the current element of ima, as a int.longgetLong(int index) longGet the array element at the current element of ima, as a long.getObject(int index) Get the array element at index as an Object.shortgetShort(int index) shortGet the array element at the current element of ima, as a short.Get 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) voidSet the array element at the current element of ima.voidsetChar(int index, char value) voidSet the array element at the current element of ima.voidsetDouble(int index, double value) voidSet the array element at the current element of ima.voidsetFloat(int index, float value) voidSet the array element at the current element of ima.voidsetInt(int index, int value) voidSet the array element at the current element of ima.voidsetLong(int index, long value) voidSet the array element at the current element of ima.voidvoidSet the array element at index to the specified value.voidsetShort(int index, short value) voidSet 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, 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
-
ArrayFloat
public ArrayFloat(int[] dimensions) Create a new Array of type float 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
Description copied from class:ArrayGet the array element at the current element of ima, as a double. -
setDouble
Description copied from class:ArraySet the array element at the current element of ima. -
getFloat
Description copied from class:ArrayGet the array element at the current element of ima, as a float. -
setFloat
Description copied from class:ArraySet the array element at the current element of ima. -
getLong
Description copied from class:ArrayGet the array element at the current element of ima, as a long. -
setLong
Description copied from class:ArraySet the array element at the current element of ima. -
getInt
Description copied from class:ArrayGet the array element at the current element of ima, as a int. -
setInt
Description copied from class:ArraySet the array element at the current element of ima. -
getShort
Description copied from class:ArrayGet the array element at the current element of ima, as a short. -
setShort
Description copied from class:ArraySet the array element at the current element of ima. -
getByte
Description copied from class:ArrayGet the array element at the current element of ima, as a byte. -
setByte
Description copied from class:ArraySet the array element at the current element of ima. -
getChar
Description copied from class:ArrayGet the array element at the current element of ima, as a char. -
setChar
Description copied from class:ArraySet the array element at the current element of ima. -
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.
-
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
-