ucar.ma2
Class ArrayScalar

java.lang.Object
  extended by ucar.ma2.Array
      extended by ucar.ma2.ArrayScalar

@Immutable
public class ArrayScalar
extends Array

Helper class for StructureDataAscii


Field Summary
 
Fields inherited from class ucar.ma2.Array
indexCalc, rank, unsigned
 
Constructor Summary
ArrayScalar(Object value)
           
 
Method Summary
 boolean getBoolean(Index ima)
          Get the array element at the current element of ima, as a boolean.
 boolean getBoolean(int elem)
           
 byte getByte(Index ima)
          Get the array element at the current element of ima, as a byte.
 byte getByte(int elem)
           
 char getChar(Index ima)
          Get the array element at the current element of ima, as a char.
 char getChar(int elem)
           
 double getDouble(Index ima)
          Get the array element at the current element of ima, as a double.
 double getDouble(int elem)
           
 Class getElementType()
          Get the element class type of this Array
 float getFloat(Index ima)
          Get the array element at the current element of ima, as a float.
 float getFloat(int elem)
           
 int getInt(Index ima)
          Get the array element at the current element of ima, as a int.
 int getInt(int elem)
           
 long getLong(Index ima)
          Get the array element at the current element of ima, as a long.
 long getLong(int elem)
           
 Object getObject(Index ima)
          Get the array element at index as an Object.
 Object getObject(int elem)
           
 short getShort(Index ima)
          Get the array element at the current element of ima, as a short.
 short getShort(int elem)
           
 Object getStorage()
          Get underlying primitive array storage.
 void setBoolean(Index ima, boolean value)
          Set the array element at the current element of ima.
 void setBoolean(int elem, boolean value)
           
 void setByte(Index ima, byte value)
          Set the array element at the current element of ima.
 void setByte(int elem, byte value)
           
 void setChar(Index ima, char value)
          Set the array element at the current element of ima.
 void setChar(int elem, char value)
           
 void setDouble(Index ima, double value)
          Set the array element at the current element of ima.
 void setDouble(int elem, double val)
           
 void setFloat(Index ima, float value)
          Set the array element at the current element of ima.
 void setFloat(int elem, float val)
           
 void setInt(Index ima, int value)
          Set the array element at the current element of ima.
 void setInt(int elem, int value)
           
 void setLong(Index ima, long value)
          Set the array element at the current element of ima.
 void setLong(int elem, long value)
           
 void setObject(Index ima, Object value)
          Set the array element at index to the specified value.
 void setObject(int elem, Object value)
           
 void setShort(Index ima, short value)
          Set the array element at the current element of ima.
 void setShort(int elem, short value)
           
 
Methods inherited from class ucar.ma2.Array
arraycopy, copy, copyTo1DJavaArray, copyToNDJavaArray, factory, factory, factory, factory, factory, factory, factoryConstant, flip, get1DJavaArray, getDataAsByteBuffer, getIndex, getIndexIterator, getIndexIteratorFast, getIndexPrivate, getRangeIterator, getRank, getShape, getSize, getSizeBytes, hasNext, isConstant, isUnsigned, makeArray, makeArray, makeArray, next, nextBoolean, nextByte, nextChar, nextDouble, nextFloat, nextInt, nextLong, nextShort, permute, reduce, reduce, resetLocalIterator, reshape, reshapeNoCopy, section, section, section, sectionNoReduce, sectionNoReduce, setUnsigned, shapeToString, slice, toString, transpose
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArrayScalar

public ArrayScalar(Object value)
Method Detail

getElementType

public Class getElementType()
Description copied from class: Array
Get the element class type of this Array

Specified by:
getElementType in class Array
Returns:
the class of the element

getStorage

public Object getStorage()
Description copied from class: Array
Get underlying primitive array storage. Exposed for efficiency, use at your own risk.

Specified by:
getStorage in class Array
Returns:
underlying primitive array storage

getDouble

public double getDouble(Index ima)
Description copied from class: Array
Get the array element at the current element of ima, as a double.

Specified by:
getDouble in class Array
Parameters:
ima - Index with current element set
Returns:
value at index cast to double if necessary.

setDouble

public void setDouble(Index ima,
                      double value)
Description copied from class: Array
Set the array element at the current element of ima.

Specified by:
setDouble in class Array
Parameters:
ima - Index with current element set
value - the new value; cast to underlying data type if necessary.

getFloat

public float getFloat(Index ima)
Description copied from class: Array
Get the array element at the current element of ima, as a float.

Specified by:
getFloat in class Array
Parameters:
ima - Index with current element set
Returns:
value at index cast to float if necessary.

setFloat

public void setFloat(Index ima,
                     float value)
Description copied from class: Array
Set the array element at the current element of ima.

Specified by:
setFloat in class Array
Parameters:
ima - Index with current element set
value - the new value; cast to underlying data type if necessary.

getLong

public long getLong(Index ima)
Description copied from class: Array
Get the array element at the current element of ima, as a long.

Specified by:
getLong in class Array
Parameters:
ima - Index with current element set
Returns:
value at index cast to long if necessary.

setLong

public void setLong(Index ima,
                    long value)
Description copied from class: Array
Set the array element at the current element of ima.

Specified by:
setLong in class Array
Parameters:
ima - Index with current element set
value - the new value; cast to underlying data type if necessary.

getInt

public int getInt(Index ima)
Description copied from class: Array
Get the array element at the current element of ima, as a int.

Specified by:
getInt in class Array
Parameters:
ima - Index with current element set
Returns:
value at index cast to int if necessary.

setInt

public void setInt(Index ima,
                   int value)
Description copied from class: Array
Set the array element at the current element of ima.

Specified by:
setInt in class Array
Parameters:
ima - Index with current element set
value - the new value; cast to underlying data type if necessary.

getShort

public short getShort(Index ima)
Description copied from class: Array
Get the array element at the current element of ima, as a short.

Specified by:
getShort in class Array
Parameters:
ima - Index with current element set
Returns:
value at index cast to short if necessary.

setShort

public void setShort(Index ima,
                     short value)
Description copied from class: Array
Set the array element at the current element of ima.

Specified by:
setShort in class Array
Parameters:
ima - Index with current element set
value - the new value; cast to underlying data type if necessary.

getByte

public byte getByte(Index ima)
Description copied from class: Array
Get the array element at the current element of ima, as a byte.

Specified by:
getByte in class Array
Parameters:
ima - Index with current element set
Returns:
value at index cast to float if necessary.

setByte

public void setByte(Index ima,
                    byte value)
Description copied from class: Array
Set the array element at the current element of ima.

Specified by:
setByte in class Array
Parameters:
ima - Index with current element set
value - the new value; cast to underlying data type if necessary.

getChar

public char getChar(Index ima)
Description copied from class: Array
Get the array element at the current element of ima, as a char.

Specified by:
getChar in class Array
Parameters:
ima - Index with current element set
Returns:
value at index cast to char if necessary.

setChar

public void setChar(Index ima,
                    char value)
Description copied from class: Array
Set the array element at the current element of ima.

Specified by:
setChar in class Array
Parameters:
ima - Index with current element set
value - the new value; cast to underlying data type if necessary.

getBoolean

public boolean getBoolean(Index ima)
Description copied from class: Array
Get the array element at the current element of ima, as a boolean.

Specified by:
getBoolean in class Array
Parameters:
ima - Index with current element set
Returns:
value at index cast to boolean if necessary.

setBoolean

public void setBoolean(Index ima,
                       boolean value)
Description copied from class: Array
Set the array element at the current element of ima.

Specified by:
setBoolean in class Array
Parameters:
ima - Index with current element set
value - the new value; cast to underlying data type if necessary.

getObject

public Object getObject(Index ima)
Description copied from class: Array
Get the array element at index as an Object. The returned value is wrapped in an object, eg Double for double

Specified by:
getObject in class Array
Parameters:
ima - element Index
Returns:
Object value at index

setObject

public void setObject(Index ima,
                      Object value)
Description copied from class: 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)

Specified by:
setObject in class Array
Parameters:
ima - Index with current element set
value - the new value.

getDouble

public double getDouble(int elem)
Specified by:
getDouble in class Array

setDouble

public void setDouble(int elem,
                      double val)
Specified by:
setDouble in class Array

getFloat

public float getFloat(int elem)
Specified by:
getFloat in class Array

setFloat

public void setFloat(int elem,
                     float val)
Specified by:
setFloat in class Array

getLong

public long getLong(int elem)
Specified by:
getLong in class Array

setLong

public void setLong(int elem,
                    long value)
Specified by:
setLong in class Array

getInt

public int getInt(int elem)
Specified by:
getInt in class Array

setInt

public void setInt(int elem,
                   int value)
Specified by:
setInt in class Array

getShort

public short getShort(int elem)
Specified by:
getShort in class Array

setShort

public void setShort(int elem,
                     short value)
Specified by:
setShort in class Array

getByte

public byte getByte(int elem)
Specified by:
getByte in class Array

setByte

public void setByte(int elem,
                    byte value)
Specified by:
setByte in class Array

getChar

public char getChar(int elem)
Specified by:
getChar in class Array

setChar

public void setChar(int elem,
                    char value)
Specified by:
setChar in class Array

getBoolean

public boolean getBoolean(int elem)
Specified by:
getBoolean in class Array

setBoolean

public void setBoolean(int elem,
                       boolean value)
Specified by:
setBoolean in class Array

getObject

public Object getObject(int elem)
Specified by:
getObject in class Array

setObject

public void setObject(int elem,
                      Object value)
Specified by:
setObject in class Array


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.