Package gov.nasa.pds.label.object
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.
- 
- 
Field Summary- 
Fields inherited from class gov.nasa.pds.label.object.DataObjectchannel, dataObjectLocation, fileObject, localIdentifier, name, offset, parentDir
 
- 
 - 
Constructor SummaryConstructors Constructor Description ArrayObject(java.io.File parentDir, File fileObject, Array array, long offset)Deprecated.ArrayObject(java.io.File parentDir, File fileObject, Array array, long offset, DataObjectLocation location)Creats a new array instance.ArrayObject(java.net.URL parent, File fileObject, Array array, long offset)Deprecated.ArrayObject(java.net.URL parent, File fileObject, Array array, long offset, DataObjectLocation location)Creates a new array instance.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.image.BufferedImageas2DImage()Returns a BufferedImage object with the type set to TYPE_BYTE_GRAY.voidclose()ArraygetArray()intgetAxes()Gets the number of dimensions.int[]getDimensions()Gets the dimensions of the array.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 4-D array, as a double.double[]getElements1D()Gets the entire 1-D array, as doubles.double[][]getElements2D()Gets the entire 2-D array, as doubles.double[][][]getElements3D()Gets the entire 3-D array, as doubles.double[][][][]getElements4D()Gets the entire 4-D array, as doubles.intgetElementSize()Gets the size of an array element.ElementTypegetElementType()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 4-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 4-D array, as a long.booleanisImage()Checks to see whether the array is an image.voidopen()voidsetArray(Array array)- 
Methods inherited from class gov.nasa.pds.label.object.DataObjectcloseChannel, getChannel, getDataFile, getDataObjectLocation, getInputStream, getLocalIdentifier, getName, getOffset, getSize, setDataObjectLocation, setLocalIdentifier, setName, setSize
 
- 
 
- 
- 
- 
Constructor Detail- 
ArrayObjectpublic ArrayObject(java.io.File parentDir, File fileObject, Array array, long offset, DataObjectLocation location) throws java.io.FileNotFoundException, java.io.IOException, java.net.URISyntaxExceptionCreats 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:
- java.io.IOException- if there is an error opening the data file
- java.io.FileNotFoundException- if the data file is not found
- java.net.URISyntaxException
 
 - 
ArrayObjectpublic ArrayObject(java.net.URL parent, File fileObject, Array array, long offset, DataObjectLocation location) throws java.io.FileNotFoundException, java.io.IOException, java.net.URISyntaxExceptionCreates a new array instance.- Parameters:
- parent- the parent directory for the data file
- fileObject- the file object metadata
- array- the array object
- offset- the offset within the data file
- Throws:
- java.io.IOException- if there is an error opening the data file
- java.io.FileNotFoundException- if the data file is not found
- java.net.URISyntaxException
 
 - 
ArrayObject@Deprecated public ArrayObject(java.net.URL parent, File fileObject, Array array, long offset) throws java.io.FileNotFoundException, java.io.IOException, java.net.URISyntaxExceptionDeprecated.Deprecated initializer. Missing DataObjectLocation- Throws:
- java.io.FileNotFoundException
- java.io.IOException
- java.net.URISyntaxException
 
 - 
ArrayObject@Deprecated public ArrayObject(java.io.File parentDir, File fileObject, Array array, long offset) throws java.io.FileNotFoundException, java.io.IOException, java.net.URISyntaxExceptionDeprecated.Deprecated initializer. Missing DataObjectLocation- Throws:
- java.io.FileNotFoundException
- java.io.IOException
- java.net.URISyntaxException
 
 
- 
 - 
Method Detail- 
getDimensionspublic int[] getDimensions() Gets the dimensions of the array.- Returns:
- an array of dimensions
 
 - 
getAxespublic int getAxes() Gets the number of dimensions.- Returns:
- the number of dimensions
 
 - 
getElementSizepublic int getElementSize() Gets the size of an array 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
 
 - 
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
 
 - 
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
 
 - 
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
 
 - 
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
 
 - 
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
 
 - 
getIntpublic int getInt(int i1, int i2, int i3, int i4) throws java.io.IOExceptionGets 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:
- java.io.IOException
 
 - 
getLongpublic long getLong(int i1, int i2, int i3, int i4) throws java.io.IOExceptionGets 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:
- java.io.IOException
 
 - 
getDoublepublic double getDouble(int i1, int i2, int i3, int i4) throws java.io.IOExceptionGets 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:
- java.io.IOException
 
 - 
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
 
 - 
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
 
 - 
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
 
 - 
getElements1Dpublic double[] getElements1D() throws java.io.IOExceptionGets the entire 1-D array, as doubles.- Returns:
- an array of double with all array elements
- Throws:
- java.io.IOException
 
 - 
getElements2Dpublic double[][] getElements2D() throws java.io.IOExceptionGets the entire 2-D array, as doubles.- Returns:
- an array of double with all array elements
- Throws:
- java.io.IOException
 
 - 
getElements3Dpublic double[][][] getElements3D() throws java.io.IOExceptionGets the entire 3-D array, as doubles.- Returns:
- an array of double with all array elements
- Throws:
- java.io.IOException
 
 - 
getElements4Dpublic double[][][][] getElements4D() throws java.io.IOExceptionGets the entire 4-D array, as doubles.- Returns:
- an array of double with all array elements
- Throws:
- java.io.IOException
 
 - 
isImagepublic boolean isImage() Checks to see whether the array is an image.- Returns:
- true, if the array is an image
 
 - 
as2DImagepublic java.awt.image.BufferedImage as2DImage() Returns a BufferedImage object with the type set to TYPE_BYTE_GRAY.- Returns:
- a BufferedImage
 
 - 
getElementTypepublic ElementType getElementType() 
 - 
getArraypublic Array getArray() 
 - 
setArraypublic void setArray(Array array) 
 - 
openpublic void open() throws java.io.IOException- Throws:
- java.io.IOException
 
 - 
closepublic void close() throws java.io.IOException- Throws:
- java.io.IOException
 
 
- 
 
-