public class NetCDFServiceImpl extends AbstractService implements NetCDFService, com.esotericsoftware.kryo.KryoSerializable
| Modifier and Type | Field and Description |
|---|---|
static String |
NO_NETCDF_MSG |
| Constructor and Description |
|---|
NetCDFServiceImpl()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes and resets the service.
|
Object |
getArray(String path,
int[] origin,
int[] shape)
Retrieves an HDF path's values.
|
Vector<String> |
getAttributeList()
Retrieves an exhaustive list of the HDF paths for all attributes in the
HDF document.
|
String |
getAttributeValue(String path)
Retrieves an attribute's value.
|
int |
getDimension(String name)
Retrieves the length of a dimension.
|
String |
getFile()
Retrieves the current initialized file path.
|
Hashtable<String,Object> |
getVariableAttributes(String name)
Retrieves all of a variable's attributes.
|
Vector<String> |
getVariableList()
Retrieves an exhaustive list of the HDF paths for all variables in the
HDF document.
|
Object |
getVariableValue(String name)
Retrieves a variable's value.
|
void |
read(com.esotericsoftware.kryo.Kryo kryo,
com.esotericsoftware.kryo.io.Input in) |
void |
setFile(String file)
Initializes the service on a given file path.
|
void |
write(com.esotericsoftware.kryo.Kryo kryo,
com.esotericsoftware.kryo.io.Output out) |
checkClassDependencypublic static final String NO_NETCDF_MSG
public void setFile(String file) throws IOException
NetCDFServicesetFile in interface NetCDFServicefile - Path to initialize the service with.IOException - If there is an error initializing the service
with file.public String getFile()
NetCDFServicegetFile in interface NetCDFServicenull if the service
has yet to be initialized or is closed.public Vector<String> getAttributeList()
NetCDFServicegetAttributeList in interface NetCDFServicepublic Vector<String> getVariableList()
NetCDFServicegetVariableList in interface NetCDFServicepublic String getAttributeValue(String path)
NetCDFServicegetAttributeValue in interface NetCDFServicepath - HDF path to the attribute.null if the attribute is not a
string.public Object getVariableValue(String name) throws ServiceException
NetCDFServicegetVariableValue in interface NetCDFServicename - HDF path to the variable.ServiceException - If there is an error with the range of values
or reading from the file.Array.copyTo1DJavaArray()public Object getArray(String path, int[] origin, int[] shape) throws ServiceException
NetCDFServicegetArray in interface NetCDFServicepath - HDF path to the values.origin - Array specifying the starting index. If null, assume
all zeroes.shape - Array specifying the extents in each dimension. This
becomes the shape of the returned Array.ServiceException - If there is an error with the range of values
or reading from the file.Variable.read(int[], int[]),
Array.copyToNDJavaArray()public Hashtable<String,Object> getVariableAttributes(String name)
NetCDFServicegetVariableAttributes in interface NetCDFServicename - HDF path to the variable.Array.copyTo1DJavaArray()public int getDimension(String name)
NetCDFServicegetDimension in interface NetCDFServicename - HDF path to the dimension.public void close()
throws IOException
NetCDFServiceclose in interface NetCDFServiceIOException - If there is an error closing the file.public void read(com.esotericsoftware.kryo.Kryo kryo,
com.esotericsoftware.kryo.io.Input in)
read in interface com.esotericsoftware.kryo.KryoSerializablepublic void write(com.esotericsoftware.kryo.Kryo kryo,
com.esotericsoftware.kryo.io.Output out)
write in interface com.esotericsoftware.kryo.KryoSerializableCopyright © 2014 Open Microscopy Environment