gov.nasa.pds.label.object
Class ArrayObject

java.lang.Object
  extended by gov.nasa.pds.label.object.DataObject
      extended by gov.nasa.pds.label.object.ArrayObject

public class ArrayObject
extends DataObject

Implements an object representing an array object in a PDS product.


Constructor Summary
ArrayObject(File parentDir, File fileObject, Array array, long offset)
          Creats a new array instance.
 
Method Summary
 int getAxes()
          Gets the number of dimensions.
 int[] getDimensions()
          Gets the dimensions of the array.
 double getDouble(int[] position)
          Gets an array element, as a double.
 double getDouble(int row, int column)
          Gets an element of a 2-D array, as a double.
 double getDouble(int i1, int i2, int i3)
          Gets an element of a 3-D array, as a double.
 double[][] getElements2D()
          Gets the entire 2-D array, as doubles.
 double[][][] getElements3D()
          Gets the entire 3-D array, as doubles.
 int getElementSize()
          Gets the size of an array element.
 int getInt(int[] position)
          Gets an array element, as an int.
 int getInt(int row, int column)
          Gets an element of a 2-D array, as an int.
 int getInt(int i1, int i2, int i3)
          Gets an element of a 3-D array, as an int.
 long getLong(int[] position)
          Gets an array element, as a long.
 long getLong(int row, int column)
          Gets an element of a 2-D array, as a long.
 long getLong(int i1, int i2, int i3)
          Gets an element of a 3-D array, as a long.
 boolean isImage()
          Checks to see whether the array is an image.
 
Methods inherited from class gov.nasa.pds.label.object.DataObject
getBuffer, getDataFile, getInputStream, getOffset, getSize, setSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayObject

public ArrayObject(File parentDir,
                   File fileObject,
                   Array array,
                   long offset)
            throws FileNotFoundException,
                   IOException
Creats a new array instance.

Parameters:
parentDir - the parent directory for the data file
fileObject - the file object metadata
array - the array object
offset - the offset within the data file
Throws:
IOException - if there is an error opening the data file
FileNotFoundException - if the data file is not found
Method Detail

getDimensions

public int[] getDimensions()
Gets the dimensions of the array.

Returns:
an array of dimensions

getAxes

public int getAxes()
Gets the number of dimensions.

Returns:
the number of dimensions

getElementSize

public int getElementSize()
Gets the size of an array element.

Returns:
the element size, in bytes

getInt

public int getInt(int row,
                  int column)
Gets an element of a 2-D array, as an int.

Parameters:
row - the row
column - the column
Returns:
the element value, as an int

getLong

public long getLong(int row,
                    int column)
Gets an element of a 2-D array, as a long.

Parameters:
row - the row
column - the column
Returns:
the element value, as a long

getDouble

public double getDouble(int row,
                        int column)
Gets an element of a 2-D array, as a double.

Parameters:
row - the row
column - the column
Returns:
the element value, as a double

getInt

public int getInt(int i1,
                  int i2,
                  int i3)
Gets an element of a 3-D array, as an int.

Parameters:
i1 - the first index
i2 - the second index
i3 - the third index
Returns:
the element value, as an int

getLong

public long getLong(int i1,
                    int i2,
                    int i3)
Gets an element of a 3-D array, as a long.

Parameters:
i1 - the first index
i2 - the second index
i3 - the third index
Returns:
the element value, as a long

getDouble

public double getDouble(int i1,
                        int i2,
                        int i3)
Gets an element of a 3-D array, as a double.

Parameters:
i1 - the first index
i2 - the second index
i3 - the third index
Returns:
the element value, as a double

getInt

public int getInt(int[] position)
Gets an array element, as an int.

Parameters:
position - the indices of the element
Returns:
the value of the element, as an int

getLong

public long getLong(int[] position)
Gets an array element, as a long.

Parameters:
position - the indices of the element
Returns:
the value of the element, as a long

getDouble

public double getDouble(int[] position)
Gets an array element, as a double.

Parameters:
position - the indices of the element
Returns:
the value of the element, as a double

getElements2D

public double[][] getElements2D()
Gets the entire 2-D array, as doubles.

Returns:
an array of double with all array elements

getElements3D

public double[][][] getElements3D()
Gets the entire 3-D array, as doubles.

Returns:
an array of double with all array elements

isImage

public boolean isImage()
Checks to see whether the array is an image.

Returns:
true, if the array is an image


Copyright © 2013. All Rights Reserved.