NeXusJavaBindings  1
 All Classes Namespaces Files Functions Variables Typedefs Macros Pages
Public Member Functions
org.nexusformat.NeXusFileInterface Interface Reference
Inheritance diagram for org.nexusformat.NeXusFileInterface:
Inheritance graph
Collaboration diagram for org.nexusformat.NeXusFileInterface:
Collaboration graph

List of all members.

Public Member Functions

void flush () throws NexusException
 flush writes all previously unsaved data to disk.
void finalize () throws Throwable
 finalize closes the file.
void close () throws NexusException
 close the NeXus file.
void makegroup (String name, String nxclass) throws NexusException
 makegroup creates a new group below the current group within the NeXus file hierarchy.
void opengroup (String name, String nxclass) throws NexusException
 opengroup opens the group name with class nxclass.
void openpath (String path) throws NexusException
 openpath opens groups and datsets accroding to the path string given.
void opengrouppath (String path) throws NexusException
 opengrouppath opens groups and datsets accroding to the path string given.
String getpath () throws NexusException
 return the current path into the NeXus file in the form of a Unix path string.
void closegroup () throws NexusException
 closegroup closes access to the current group and steps down one step in group hierarchy.
void makedata (String name, int type, int rank, int dim[]) throws NexusException
 makedata creates a new dataset with the specified characteristics in the current group.
void makedata (String name, int type, int rank, long dim[]) throws NexusException
 makedata creates a new dataset with the specified characteristics in the current group.
void compmakedata (String name, int type, int rank, int dim[], int compression_type, int iChunk[]) throws NexusException
 compmakedata creates a new dataset with the specified characteristics in the current group.
void compmakedata (String name, int type, int rank, long dim[], int compression_type, long iChunk[]) throws NexusException
 compmakedata creates a new dataset with the specified characteristics in the current group.
void opendata (String name) throws NexusException
 opendata opens an existing dataset for access.
void closedata () throws NexusException
 closedata closes an opened dataset.
void compress (int compression_type) throws NexusException
 causes the currently open dataset to be compressed on file.
void getdata (Object array) throws NexusException
 getdata reads the data from an previously openend dataset into array.
void getslab (int start[], int size[], Object array) throws NexusException
 getslab reads a subset of a large dataset into array.
void getslab (long start[], long size[], Object array) throws NexusException
 getslab reads a subset of a large dataset into array.
void getattr (String name, Object data, int args[]) throws NexusException
 getattr retrieves the data associated with the attribute name.
void putdata (Object array) throws NexusException
 putdata writes the data from array into a previously opened dataset.
void putslab (Object array, int start[], int size[]) throws NexusException
 putslab writes a subset of a larger dataset to a previously opened dataset.
void putslab (Object array, long start[], long size[]) throws NexusException
 putslab writes a subset of a larger dataset to a previously opened dataset.
void putattr (String name, Object array, int iType) throws NexusException
 putattr adds a named attribute to a previously opened dataset or a global attribute if no dataset is open.
void getinfo (int iDim[], int args[]) throws NexusException
 getinfo retrieves information about a previously opened dataset.
void getinfo (long iDim[], int args[]) throws NexusException
 getinfo retrieves information about a previously opened dataset.
void setnumberformat (int type, String format) throws NexusException
 setnumberformat sets the number format for printing number when using the XML-NeXus format.
Hashtable groupdir () throws NexusException
 groupdir will retrieve the content of the currently open vGroup.
Hashtable attrdir () throws NexusException
 attrdir returns the attributes of the currently open dataset or the file global attributes if no dataset is open.
NXlink getgroupID () throws NexusException
 getgroupID gets the data necessary for linking the current vGroup somewhere else.
NXlink getdataID () throws NexusException
 getdataID gets the data necessary for linking the current dataset somewhere else.
void makelink (NXlink target) throws NexusException
 makelink links the object described by target into the current vGroup.
void makenamedlink (String name, NXlink target) throws NexusException
 makenamedlink links the object described by target into the current vGroup.
void opensourcepath () throws NexusException
 opensourcepath opens the group from which the current item was linked Returns an error if the current item is not linked.
String inquirefile () throws NexusException
 inquirefile inquires which file we are currently in.
void linkexternal (String name, String nxclass, String nxurl) throws NexusException
 linkexternal links group name, nxclass to the URL nxurl
void linkexternaldataset (String name, String nxurl) throws NexusException
 linkexternaldataset links dataset name to the URL nxurl
String isexternalgroup (String name, String nxclass) throws NexusException
 nxisexternalgroup test the group name, nxclass if it is linked externally
String isexternaldataset (String name) throws NexusException
 nxisexternaldataset if the named dataset is is linked externally

Detailed Description

Definition at line 21 of file NeXusFileInterface.java.


Member Function Documentation

Hashtable org.nexusformat.NeXusFileInterface.attrdir ( ) throws NexusException

attrdir returns the attributes of the currently open dataset or the file global attributes if no dataset is open.

Returns:
A Hashtable which will hold the names of the attributes as keys. For each key there is an AttributeEntry class as value.
Exceptions:
NexusExceptionwhen an HDF error occurs.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.close ( ) throws NexusException

close the NeXus file.

To make javalint and diamond happy

Exceptions:
NexusException

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.closedata ( ) throws NexusException

closedata closes an opened dataset.

Then no further access is possible without a call to opendata.

Exceptions:
NexusExceptionwhen an HDF error occurrs.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.closegroup ( ) throws NexusException

closegroup closes access to the current group and steps down one step in group hierarchy.

Exceptions:
NexusExceptionwhen an HDF error occurs during this operation.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.compmakedata ( String  name,
int  type,
int  rank,
int  dim[],
int  compression_type,
int  iChunk[] 
) throws NexusException

compmakedata creates a new dataset with the specified characteristics in the current group.

This data set will be compressed.

Parameters:
nameThe name of the dataset.
typeThe number type of the dataset. Usually a constant from a selection of values.
rankThe rank or number of dimensions of the dataset.
dimAn array containing the length of each dimension. dim must have at least rank entries. Dimension passed as -1 denote an unlimited dimension.
compression_typedetermines the compression type.
iChunkWith HDF-5, slabs can be written to compressed data sets. The size of these slabs is specified through the chunk array. This must have the rank values for the size of the chunk to be written in each dimension.
Exceptions:
NexusExceptionwhen the dataset could not be created.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.compmakedata ( String  name,
int  type,
int  rank,
long  dim[],
int  compression_type,
long  iChunk[] 
) throws NexusException

compmakedata creates a new dataset with the specified characteristics in the current group.

This data set will be compressed.

Parameters:
nameThe name of the dataset.
typeThe number type of the dataset. Usually a constant from a selection of values.
rankThe rank or number of dimensions of the dataset.
dimAn array containing the length of each dimension. dim must have at least rank entries. Dimension passed as -1 denote an unlimited dimension.
compression_typedetermines the compression type.
iChunkWith HDF-5, slabs can be written to compressed data sets. The size of these slabs is specified through the chunk array. This must have the rank values for the size of the chunk to be written in each dimension.
Exceptions:
NexusExceptionwhen the dataset could not be created.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.compress ( int  compression_type) throws NexusException

causes the currently open dataset to be compressed on file.

This must be called after makedata and before writing to the dataset.

Parameters:
compression_typedetermines the type of compression to use.
Exceptions:
NexusExceptionwhen no dataset is open or an HDF error occurs.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.finalize ( ) throws Throwable

finalize closes the file.

It is supposed to be called by the garbage collector when the object is collected. As this happens at discretion of the garbage collector it is safer to call finalize yourself, when a NeXus file needs to be closed. Multiple calls to finalize do no harm.

Exceptions:
Throwablebecause it is required by the definition of finalize.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.flush ( ) throws NexusException

flush writes all previously unsaved data to disk.

All directory searches are invalidated. Any open SDS is closed.

Exceptions:
NexusExceptionif an HDF error occurs.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.getattr ( String  name,
Object  data,
int  args[] 
) throws NexusException

getattr retrieves the data associated with the attribute name.

Parameters:
nameThe name of the attribute.
dataan array with sufficient space for holding the attribute data.
argsAn integer array holding the number of data elements in data as args[0], and the type as args[1]. Both values will be updated while reading.
Exceptions:
NexusExceptionwhen either an HDF error occurs or the attribute could not be found.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.getdata ( Object  array) throws NexusException

getdata reads the data from an previously openend dataset into array.

Parameters:
arrayAn n-dimensional array of the appropriate number type for the dataset. Make sure to have the right type and size here.
Exceptions:
NexusExceptionwhen either an HDF error occurs or no dataset is open or array is not of the right type to hold the data.

Implemented in org.nexusformat.NexusFile.

NXlink org.nexusformat.NeXusFileInterface.getdataID ( ) throws NexusException

getdataID gets the data necessary for linking the current dataset somewhere else.

Returns:
A NXlink object holding the link data.
Exceptions:
NexusExceptionif an HDF error occurs.

Implemented in org.nexusformat.NexusFile.

NXlink org.nexusformat.NeXusFileInterface.getgroupID ( ) throws NexusException

getgroupID gets the data necessary for linking the current vGroup somewhere else.

Returns:
A NXlink object holding the link data.
Exceptions:
NexusExceptionif an HDF error occurs.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.getinfo ( int  iDim[],
int  args[] 
) throws NexusException

getinfo retrieves information about a previously opened dataset.

Parameters:
iDimAn array which will be filled with the size of the dataset in each dimension.
argsAn integer array which will hold more information about the dataset after return. The fields: args[0] is the rank, args[1] is the number type.
Exceptions:
NexusExceptionwhen an HDF error occurs.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.getinfo ( long  iDim[],
int  args[] 
) throws NexusException

getinfo retrieves information about a previously opened dataset.

Parameters:
iDimAn array which will be filled with the size of the dataset in each dimension.
argsAn integer array which will hold more information about the dataset after return. The fields: args[0] is the rank, args[1] is the number type.
Exceptions:
NexusExceptionwhen an HDF error occurs.

Implemented in org.nexusformat.NexusFile.

String org.nexusformat.NeXusFileInterface.getpath ( ) throws NexusException

return the current path into the NeXus file in the form of a Unix path string.

Returns:
A unix path string

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.getslab ( int  start[],
int  size[],
Object  array 
) throws NexusException

getslab reads a subset of a large dataset into array.

Parameters:
startAn array of dimension rank which contains the start position in the dataset from where to start reading.
sizeAn array of dimension rank which contains the size in each dimension of the data subset to read.
arrayAn array for holding the returned data values.
Exceptions:
NexusExceptionwhen either an HDF error occurs or no dataset is open or array is not of the right type to hold the data.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.getslab ( long  start[],
long  size[],
Object  array 
) throws NexusException

getslab reads a subset of a large dataset into array.

Parameters:
startAn array of dimension rank which contains the start position in the dataset from where to start reading.
sizeAn array of dimension rank which contains the size in each dimension of the data subset to read.
arrayAn array for holding the returned data values.
Exceptions:
NexusExceptionwhen either an HDF error occurs or no dataset is open or array is not of the right type to hold the data.

Implemented in org.nexusformat.NexusFile.

Hashtable org.nexusformat.NeXusFileInterface.groupdir ( ) throws NexusException

groupdir will retrieve the content of the currently open vGroup.

groupdir is similar to an ls in unix.

Returns:
A Hashtable which will hold the names of the items in the group as keys and the NeXus classname for vGroups or the string 'SDS' for datasets as values.
Exceptions:
NexusExceptionif an HDF error occurs

Implemented in org.nexusformat.NexusFile.

String org.nexusformat.NeXusFileInterface.inquirefile ( ) throws NexusException

inquirefile inquires which file we are currently in.

This is a support function for external linking

Returns:
The current file
Exceptions:
NexusExceptionwhen things are wrong

Implemented in org.nexusformat.NexusFile.

String org.nexusformat.NeXusFileInterface.isexternaldataset ( String  name) throws NexusException

nxisexternaldataset if the named dataset is is linked externally

Parameters:
nameof the dataset to test
Returns:
null when the it is not linked, else a string giving the URL of the linked resource
Exceptions:
NexusExceptionif things are wrong

Implemented in org.nexusformat.NexusFile.

String org.nexusformat.NeXusFileInterface.isexternalgroup ( String  name,
String  nxclass 
) throws NexusException

nxisexternalgroup test the group name, nxclass if it is linked externally

Parameters:
nameof the group to test
nxclassclass of the group to test
Returns:
null when the group is not linked, else a string giving the URL of the linked resource
Exceptions:
NexusExceptionif things are wrong

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.linkexternal ( String  name,
String  nxclass,
String  nxurl 
) throws NexusException

linkexternal links group name, nxclass to the URL nxurl

Parameters:
nameThe name of the vgroup to link to
nxclassThe class name of the linked vgroup
nxurlThe URL to the linked external file
Exceptions:
NexusExceptionif things are wrong

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.linkexternaldataset ( String  name,
String  nxurl 
) throws NexusException

linkexternaldataset links dataset name to the URL nxurl

Parameters:
nameThe name of the dataset to link to
nxurlThe URL to the linked external file
Exceptions:
NexusExceptionif things are wrong

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.makedata ( String  name,
int  type,
int  rank,
int  dim[] 
) throws NexusException

makedata creates a new dataset with the specified characteristics in the current group.

Parameters:
nameThe name of the dataset.
typeThe number type of the dataset. Usually a constant from a selection of values.
rankThe rank or number of dimensions of the dataset.
dimAn array containing the length of each dimension. dim must have at least rank entries. Dimension passed as -1 denote an unlimited dimension.
Exceptions:
NexusExceptionwhen the dataset could not be created.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.makedata ( String  name,
int  type,
int  rank,
long  dim[] 
) throws NexusException

makedata creates a new dataset with the specified characteristics in the current group.

Parameters:
nameThe name of the dataset.
typeThe number type of the dataset. Usually a constant from a selection of values.
rankThe rank or number of dimensions of the dataset.
dimAn array containing the length of each dimension. dim must have at least rank entries. Dimension passed as -1 denote an unlimited dimension.
Exceptions:
NexusExceptionwhen the dataset could not be created.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.makegroup ( String  name,
String  nxclass 
) throws NexusException

makegroup creates a new group below the current group within the NeXus file hierarchy.

Parameters:
nameThe name of the group to create.
nxclassThe classname of the group.
Exceptions:
NexusExceptionif an error occurs during this operation.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.makelink ( NXlink  target) throws NexusException

makelink links the object described by target into the current vGroup.

Parameters:
targetThe Object to link into the current group.
Exceptions:
NexusExceptionif an error occurs.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.makenamedlink ( String  name,
NXlink  target 
) throws NexusException

makenamedlink links the object described by target into the current vGroup.

The object will have a new name in the group into which it is linked

Parameters:
targetThe Object to link into the current group.
nameThe name of this object in the current group
Exceptions:
NexusExceptionif an error occurs.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.opendata ( String  name) throws NexusException

opendata opens an existing dataset for access.

For instance for reading or writing.

Parameters:
nameThe name of the dataset to open.
Exceptions:
NexusExceptionwhen the dataset does not exist or something else is wrong.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.opengroup ( String  name,
String  nxclass 
) throws NexusException

opengroup opens the group name with class nxclass.

The group must exist, otherwise an exception is thrown. opengroup is similar to a cd name in a filesystem.

Parameters:
namethe name of the group to open.
nxclassthe classname of the group to open.
Exceptions:
NexusExceptionwhen something goes wrong.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.opengrouppath ( String  path) throws NexusException

opengrouppath opens groups and datsets accroding to the path string given.

The path syntax follows unix conventions. Both absolute and relative paths are possible. All objects of the path must exist. This function stops int the last group.

Parameters:
pathThe path string
Exceptions:
NexusExceptionwhen something goes wrong.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.openpath ( String  path) throws NexusException

openpath opens groups and datsets accroding to the path string given.

The path syntax follows unix conventions. Both absolute and relative paths are possible. All objects of the path must exist.

Parameters:
pathThe path string
Exceptions:
NexusExceptionwhen something goes wrong.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.opensourcepath ( ) throws NexusException

opensourcepath opens the group from which the current item was linked Returns an error if the current item is not linked.

Exceptions:
NexusExceptionif an error occurs.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.putattr ( String  name,
Object  array,
int  iType 
) throws NexusException

putattr adds a named attribute to a previously opened dataset or a global attribute if no dataset is open.

Parameters:
nameThe name of the attribute.
arrayThe data of the attribute.
iTypeThe number type of the attribute.
Exceptions:
NexusExceptionif an HDF error occurs.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.putdata ( Object  array) throws NexusException

putdata writes the data from array into a previously opened dataset.

Parameters:
arrayThe data to write.
Exceptions:
NexusExceptionwhen an HDF error occurs.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.putslab ( Object  array,
int  start[],
int  size[] 
) throws NexusException

putslab writes a subset of a larger dataset to a previously opened dataset.

Parameters:
arrayThe data to write.
startAn integer array of dimension rank which holds the startcoordinates of the data subset in the larger dataset.
sizeAn integer array of dimension rank whidh holds the size in each dimension of the data subset to write.
Exceptions:
NexusExceptionwhen an HDF error occurs.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.putslab ( Object  array,
long  start[],
long  size[] 
) throws NexusException

putslab writes a subset of a larger dataset to a previously opened dataset.

Parameters:
arrayThe data to write.
startAn integer array of dimension rank which holds the startcoordinates of the data subset in the larger dataset.
sizeAn integer array of dimension rank whidh holds the size in each dimension of the data subset to write.
Exceptions:
NexusExceptionwhen an HDF error occurs.

Implemented in org.nexusformat.NexusFile.

void org.nexusformat.NeXusFileInterface.setnumberformat ( int  type,
String  format 
) throws NexusException

setnumberformat sets the number format for printing number when using the XML-NeXus format.

For HDF4 and HDF5 this is ignored. If a dataset is open, the format for the dataset is set, if none is open the default setting for the number type is changed. The format must be a ANSII-C language format string.

Parameters:
typeThe NeXus type to set the format for.
formatThe new format to use.

Implemented in org.nexusformat.NexusFile.


The documentation for this interface was generated from the following file: