All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface neutron.nexus.NeXusFileInterface

public interface NeXusFileInterface

Method Index

 o attrdir()
attrdir returns the attributes of the currently open dataset or the file global attributes if no dataset is open.
 o closedata()
closedata closes an opened dataset.
 o closegroup()
closegroup closes access to the current group and steps down one step in group hierarchy.
 o compress(int)
causes the currently open dataset to be compressed on file.
 o finalize()
finalize closes the file.
 o flush()
flush writes all previously unsaved data to disk.
 o getattr(String, Object, int[])
getattr retrieves the data associated with the attribute name.
 o getdata(Object)
getdata reads the data from an previously openend dataset into array.
 o getdataID()
getdataID gets the data necessary for linking the current dataset somewhere else.
 o getgroupID()
getgroupID gets the data necessary for linking the current vGroup somewhere else.
 o getinfo(int[], int[])
getinfo retrieves information about a previously opened dataset.
 o getslab(int[], int[], Object)
getslab reads a subset of a large dataset into array.
 o groupdir()
groupdir will retrieve the content of the currently open vGroup.
 o makedata(String, int, int, int[])
makedata creates a new dataset with the specified characteristics in the current group.
 o makegroup(String, String)
makegroup creates a new group below the current group within the NeXus file hierarchy.
 o makelink(NXlink)
makelink links the object described by target into the current vGroup.
 o opendata(String)
opendata opens an existing dataset for access.
 o opengroup(String, String)
opengroup opens the group name with class nxclass.
 o putattr(String, Object, int)
putattr adds a named attribute to a previously opened dataset or a global attribute if no dataset is open.
 o putdata(Object)
putdata writes the data from array into a previously opened dataset.
 o putslab(Object, int[], int[])
putslab writes a subset of a larger dataset to a previously opened dataset.

Methods

 o flush
 public abstract void flush() throws NexusException
flush writes all previously unsaved data to disk. All directory searches are invalidated. Any open SDS is closed.

Throws: NexusException
if an HDF error occurs.
 o finalize
 public abstract void 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.

Throws: Throwable
because it is required by the definition of finalize.
Overrides:
finalize in class Object
 o makegroup
 public abstract void makegroup(String name,
                                String nxclass) throws NexusException
makegroup creates a new group below the current group within the NeXus file hierarchy.

Parameters:
name - The name of the group to create.
nxclass - The classname of the group.
Throws: NexusException
if an error occurs during this operation.
 o opengroup
 public abstract void 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:
name - the name of the group to open.
nxclass - the classname of the group to open.
Throws: NexusException
when something goes wrong.
 o closegroup
 public abstract void closegroup() throws NexusException
closegroup closes access to the current group and steps down one step in group hierarchy.

Throws: NexusException
when an HDF error occurs during this operation.
 o makedata
 public abstract 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.

Parameters:
name - The name of the dataset.
type - The number type of the dataset. Usually a constant from a selection of values.
rank - The rank or number of dimensions of the dataset.
dim - An array containing the length of each dimension. dim must have at least rank entries. The first dimension can be 0 which means it is an unlimited dimension.
Throws: NexusException
when the dataset could not be created.
 o opendata
 public abstract void opendata(String name) throws NexusException
opendata opens an existing dataset for access. For instance for reading or writing.

Parameters:
name - The name of the dataset to open.
Throws: NexusException
when the dataset does not exist or something else is wrong.
 o closedata
 public abstract void closedata() throws NexusException
closedata closes an opened dataset. Then no further access is possible without a call to opendata.

Throws: NexusException
when an HDF error occurrs.
 o compress
 public abstract void 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_type - determines the type of compression to use.
Throws: NexusException
when no dataset is open or an HDF error occurs.
 o getdata
 public abstract void getdata(Object arrary) throws NexusException
getdata reads the data from an previously openend dataset into array.

Parameters:
array - An n-dimensional array of the appropriate number type for the dataset. Make sure to have the right type and size here.
Throws: NexusException
when either an HDF error occurs or no dataset is open or array is not of the right type to hold the data.
 o getslab
 public abstract void getslab(int start[],
                              int size[],
                              Object array) throws NexusException
getslab reads a subset of a large dataset into array.

Parameters:
start - An array of dimension rank which contains the start position in the dataset from where to start reading.
size - An array of dimension rank which contains the size in each dimension of the data subset to read.
array - An array for holding the returned data values.
Throws: NexusException
when either an HDF error occurs or no dataset is open or array is not of the right type to hold the data.
 o getattr
 public abstract void getattr(String name,
                              Object data,
                              int args[]) throws NexusException
getattr retrieves the data associated with the attribute name.

Parameters:
name - The name of the attribute.
array - an array with sufficient space for holding the attribute data.
start - An integer array of dimension rank which holds the start position in the dataset where to start reading the slab.
size - An integer array of dimension rank which holds the size of the slab to read in each dimension.
Throws: NexusException
when either an HDF error occurs or the attribute could not be found.
 o putdata
 public abstract void putdata(Object array) throws NexusException
putdata writes the data from array into a previously opened dataset.

Parameters:
array - The data to read.
args - An integer array holding the number of data elements in array as args[0], and the type as args[1]. Both values will be updated while reading.
Throws: NexusException
when an HDF error occurs.
 o putslab
 public abstract void putslab(Object array,
                              int start[],
                              int size[]) throws NexusException
putslab writes a subset of a larger dataset to a previously opened dataset.

Parameters:
array - The data to write.
start - An integer array of dimension rank which holds the startcoordinates of the data subset in the larger dataset.
size - An integer array of dimension rank whidh holds the size in each dimension of the data subset to write.
Throws: NexusException
when an HDF error occurs.
 o putattr
 public abstract 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.

Parameters:
name - The name of the attribute.
array - The data of the attribute.
iType - The number type of the attribute.
Throws: NexusException
if an HDF error occurs.
 o getinfo
 public abstract void getinfo(int iDim[],
                              int args[]) throws NexusException
getinfo retrieves information about a previously opened dataset.

Parameters:
iDim - An array which will be filled with the size of the dataset in each dimension.
args - An 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.
Throws: NexusException
when an HDF error occurs.
 o groupdir
 public abstract Hashtable 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.
Throws: NexusException
if an HDF error occurs
 o attrdir
 public abstract Hashtable 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.
Throws: NexusException
when an HDF error occurs.
 o getgroupID
 public abstract NXlink getgroupID() throws NexusException
getgroupID gets the data necessary for linking the current vGroup somewhere else.

Returns:
A NXlink object holding the link data.
Throws: NexusException
if an HDF error occurs.
 o getdataID
 public abstract NXlink getdataID() throws NexusException
getdataID gets the data necessary for linking the current dataset somewhere else.

Returns:
A NXlink object holding the link data.
Throws: NexusException
if an HDF error occurs.
 o makelink
 public abstract void makelink(NXlink target) throws NexusException
makelink links the object described by target into the current vGroup.

Parameters:
target - The Object to link into the current group.
Throws: NexusException
if an error occurs.

All Packages  Class Hierarchy  This Package  Previous  Next  Index