Package gov.nasa.pds.objectAccess.array
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, 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 doublegetDouble(int[] position)Gets an array element, as a double.doublegetDouble(int row, int column)Gets an element of a 2-D array, as a double.doublegetDouble(int i1, int i2, int i3)Gets an element of a 3-D array, as a double.intgetElementSize()Gets the size of each element.intgetInt(int[] position)Gets an array element, as an int.intgetInt(int row, int column)Gets an element of a 2-D array, as an int.intgetInt(int i1, int i2, int i3)Gets an element of a 3-D array, as an int.longgetLong(int[] position)Gets an array element, as a long.longgetLong(int row, int column)Gets an element of a 2-D array, as a long.longgetLong(int i1, int i2, int i3)Gets an element of a 3-D array, as a long.
-
Constructor Details
-
ArrayAdapter
Creates a new array adapter with given dimensions, a channel with the array data, and element data type name.- Parameters:
dimensions- the array dimensionschannel- the channel object containing the array dataelementType- the elmeent type
-
-
Method Details
-
getElementSize
public int getElementSize()Gets the size of each element.- Returns:
- the element size, in bytes
-
getInt
Gets an element of a 2-D array, as an int.- Parameters:
row- the rowcolumn- the column- Returns:
- the element value, as an int
- Throws:
IOException
-
getLong
Gets an element of a 2-D array, as a long.- Parameters:
row- the rowcolumn- the column- Returns:
- the element value, as a long
- Throws:
IOException
-
getDouble
Gets an element of a 2-D array, as a double.- Parameters:
row- the rowcolumn- the column- Returns:
- the element value, as a double
- Throws:
IOException
-
getInt
Gets an element of a 3-D array, as an int.- Parameters:
i1- the first indexi2- the second indexi3- the third index- Returns:
- the element value, as an int
- Throws:
IOException
-
getLong
Gets an element of a 3-D array, as a long.- Parameters:
i1- the first indexi2- the second indexi3- the third index- Returns:
- the element value, as a long
- Throws:
IOException
-
getDouble
Gets an element of a 3-D array, as a double.- Parameters:
i1- the first indexi2- the second indexi3- the third index- Returns:
- the element value, as a double
- Throws:
IOException
-
getInt
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
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
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
-