Class ArrayObject

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

public class ArrayObject extends DataObject
Implements an object representing an array object in a PDS product.
  • Constructor Details

  • Method Details

    • 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) throws IOException
      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
      Throws:
      IOException
    • getLong

      public long getLong(int row, int column) throws IOException
      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
      Throws:
      IOException
    • getDouble

      public double getDouble(int row, int column) throws IOException
      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
      Throws:
      IOException
    • getInt

      public int getInt(int i1, int i2, int i3) throws IOException
      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
      Throws:
      IOException
    • getLong

      public long getLong(int i1, int i2, int i3) throws IOException
      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
      Throws:
      IOException
    • getDouble

      public double getDouble(int i1, int i2, int i3) throws IOException
      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
      Throws:
      IOException
    • getInt

      public int getInt(int i1, int i2, int i3, int i4) throws IOException
      Gets an element of a 4-D array, as an int.
      Parameters:
      i1 - the first index
      i2 - the second index
      i3 - the third index
      i4 - the fourth index
      Returns:
      the element value, as an int
      Throws:
      IOException
    • getLong

      public long getLong(int i1, int i2, int i3, int i4) throws IOException
      Gets an element of a 4-D array, as a long.
      Parameters:
      i1 - the first index
      i2 - the second index
      i3 - the third index
      i4 - the fourth index
      Returns:
      the element value, as a long
      Throws:
      IOException
    • getDouble

      public double getDouble(int i1, int i2, int i3, int i4) throws IOException
      Gets an element of a 4-D array, as a double.
      Parameters:
      i1 - the first index
      i2 - the second index
      i3 - the third index
      i4 - the fourth index
      Returns:
      the element value, as a double
      Throws:
      IOException
    • getInt

      public int getInt(int[] position) throws IOException
      Gets an array element, as an int.
      Parameters:
      position - the indices of the element
      Returns:
      the value of the element, as an int
      Throws:
      IOException
    • getLong

      public long getLong(int[] position) throws IOException
      Gets an array element, as a long.
      Parameters:
      position - the indices of the element
      Returns:
      the value of the element, as a long
      Throws:
      IOException
    • getDouble

      public double getDouble(int[] position) throws IOException
      Gets an array element, as a double.
      Parameters:
      position - the indices of the element
      Returns:
      the value of the element, as a double
      Throws:
      IOException
    • getElements1D

      public double[] getElements1D() throws IOException
      Gets the entire 1-D array, as doubles.
      Returns:
      an array of double with all array elements
      Throws:
      IOException
    • getElements2D

      public double[][] getElements2D() throws IOException
      Gets the entire 2-D array, as doubles.
      Returns:
      an array of double with all array elements
      Throws:
      IOException
    • getElements3D

      public double[][][] getElements3D() throws IOException
      Gets the entire 3-D array, as doubles.
      Returns:
      an array of double with all array elements
      Throws:
      IOException
    • getElements4D

      public double[][][][] getElements4D() throws IOException
      Gets the entire 4-D array, as doubles.
      Returns:
      an array of double with all array elements
      Throws:
      IOException
    • isImage

      public boolean isImage()
      Checks to see whether the array is an image.
      Returns:
      true, if the array is an image
    • as2DImage

      public BufferedImage as2DImage()
      Returns a BufferedImage object with the type set to TYPE_BYTE_GRAY.
      Returns:
      a BufferedImage
    • getElementType

      public ElementType getElementType()
    • getArray

      public Array getArray()
    • setArray

      public void setArray(Array array)
    • open

      public void open() throws IOException
      Throws:
      IOException
    • close

      public void close() throws IOException
      Throws:
      IOException