Package gov.nasa.pds.objectAccess.array
Class ArrayAdapter
- java.lang.Object
- 
- gov.nasa.pds.objectAccess.array.ArrayAdapter
 
- 
 public class ArrayAdapter extends java.lang.ObjectImplements a class that gives access to the elements of an array.
- 
- 
Constructor SummaryConstructors 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, java.nio.channels.SeekableByteChannel channel, ElementType elementType)Creates a new array adapter with given dimensions, a channel with the array data, and element data type name.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()gov.nasa.pds.objectAccess.array.ArrayAdapter.MappedBuffergetBuf()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.doublegetDouble(int i1, int i2, int i3, int i4)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.intgetInt(int i1, int i2, int i3, int i4)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.longgetLong(int i1, int i2, int i3, int i4)Gets an element of a 3-D array, as a long.voidopen(java.nio.channels.SeekableByteChannel channel)
 
- 
- 
- 
Constructor Detail- 
ArrayAdapterpublic 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
 
 - 
ArrayAdapterpublic ArrayAdapter(int[] dimensions, java.nio.channels.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 Detail- 
getElementSizepublic int getElementSize() Gets the size of each element.- Returns:
- the element size, in bytes
 
 - 
getIntpublic int getInt(int row, int column) throws java.io.IOExceptionGets 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:
- java.io.IOException- an exception
 
 - 
getLongpublic long getLong(int row, int column) throws java.io.IOExceptionGets 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:
- java.io.IOException- an exception
 
 - 
getDoublepublic double getDouble(int row, int column) throws java.io.IOExceptionGets 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:
- java.io.IOException- an exception
 
 - 
getIntpublic int getInt(int i1, int i2, int i3) throws java.io.IOExceptionGets 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:
- java.io.IOException- an exception
 
 - 
getLongpublic long getLong(int i1, int i2, int i3) throws java.io.IOExceptionGets 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:
- java.io.IOException- an exception
 
 - 
getDoublepublic double getDouble(int i1, int i2, int i3) throws java.io.IOExceptionGets 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:
- java.io.IOException- an exception
 
 - 
getIntpublic int getInt(int i1, int i2, int i3, int i4) throws java.io.IOExceptionGets 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:
- java.io.IOException- an exception
 
 - 
getLongpublic long getLong(int i1, int i2, int i3, int i4) throws java.io.IOExceptionGets 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:
- java.io.IOException- an exception
 
 - 
getDoublepublic double getDouble(int i1, int i2, int i3, int i4) throws java.io.IOExceptionGets 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:
- java.io.IOException- an exception
 
 - 
getIntpublic int getInt(int[] position) throws java.io.IOExceptionGets an array element, as an int.- Parameters:
- position- the indices of the element
- Returns:
- the value of the element, as an int
- Throws:
- java.io.IOException- an exception
 
 - 
getLongpublic long getLong(int[] position) throws java.io.IOExceptionGets an array element, as a long.- Parameters:
- position- the indices of the element
- Returns:
- the value of the element, as a long
- Throws:
- java.io.IOException- an exception
 
 - 
getDoublepublic double getDouble(int[] position) throws java.io.IOExceptionGets an array element, as a double.- Parameters:
- position- the indices of the element
- Returns:
- the value of the element, as a double
- Throws:
- java.io.IOException- an exception
 
 - 
getBufpublic gov.nasa.pds.objectAccess.array.ArrayAdapter.MappedBuffer getBuf() 
 - 
openpublic void open(java.nio.channels.SeekableByteChannel channel) 
 - 
closepublic void close() throws java.io.IOException- Throws:
- java.io.IOException
 
 
- 
 
-