Class ArrayAdapter

java.lang.Object
gov.nasa.pds.objectAccess.array.ArrayAdapter

public class ArrayAdapter extends Object
Implements a class that gives access to the elements of an array.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ArrayAdapter(int[] dimensions, ElementType elementType)
    Creates a new array adapter with given dimensions, a channel with the array data, and element data type name.
    ArrayAdapter(int[] dimensions, SeekableByteChannel channel, ElementType elementType)
    Creates a new array adapter with given dimensions, a channel with the array data, and element data type name.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    gov.nasa.pds.objectAccess.array.ArrayAdapter.MappedBuffer
     
    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
    getDouble(int i1, int i2, int i3, int i4)
    Gets an element of a 3-D array, as a double.
    int
    Gets the size of each 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.
    int
    getInt(int i1, int i2, int i3, int i4)
    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.
    long
    getLong(int i1, int i2, int i3, int i4)
    Gets an element of a 3-D array, as a long.
    void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ArrayAdapter

      public ArrayAdapter(int[] dimensions, ElementType elementType)
      Creates a new array adapter with given dimensions, a channel with the array data, and element data type name.
      Parameters:
      dimensions - the array dimensions
      elementType - the element type
    • ArrayAdapter

      public ArrayAdapter(int[] dimensions, SeekableByteChannel channel, ElementType elementType)
      Creates a new array adapter with given dimensions, a channel with the array data, and element data type name.
      Parameters:
      dimensions - the array dimensions
      channel - the channel object containing the array data
      elementType - the element type
  • Method Details

    • getElementSize

      public int getElementSize()
      Gets the size of each 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 - an exception
    • 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 - an exception
    • 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 - an exception
    • 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 - an exception
    • 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 - an exception
    • 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 - an exception
    • getInt

      public int getInt(int i1, int i2, int i3, int i4) 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
      i4 - the fourth index
      Returns:
      the element value, as an int
      Throws:
      IOException - an exception
    • getLong

      public long getLong(int i1, int i2, int i3, int i4) 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
      i4 - the fourth index
      Returns:
      the element value, as a long
      Throws:
      IOException - an exception
    • getDouble

      public double getDouble(int i1, int i2, int i3, int i4) 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
      i4 - the fourth index
      Returns:
      the element value, as a double
      Throws:
      IOException - an exception
    • 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 - an exception
    • 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 - an exception
    • 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 - an exception
    • getBuf

      public gov.nasa.pds.objectAccess.array.ArrayAdapter.MappedBuffer getBuf()
    • open

      public void open(SeekableByteChannel channel)
    • close

      public void close() throws IOException
      Throws:
      IOException