NeXusJavaBindings  1
 All Classes Namespaces Files Functions Variables Typedefs Macros Pages
Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes
org.nexusformat.NexusFile Class Reference
Inheritance diagram for org.nexusformat.NexusFile:
Inheritance graph
Collaboration diagram for org.nexusformat.NexusFile:
Collaboration graph

List of all members.

Public Member Functions

 NexusFile (String filename, int access) throws NexusException
 constructs a new NexusFile Object.
void flush () throws NexusException
 flushes all pending data to disk.
void close () throws NexusException
 close the NeXus file.
void finalize () throws Throwable
 removes all NeXus file data structures and closes the 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 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 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 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 array, 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 setnumberformat (int type, String format) throws NexusException
 setnumberformat sets the number format for printing number when using the XML-NeXus format.
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.
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
native void debugstop ()
 debugstop is a debugging helper function which goes into an endless loop in the dynamic link library.

Static Public Attributes

static final int NXACC_READ = 1
 possible access codes,
static final int NXACC_RDWR = 2
static final int NXACC_CREATE = 3
static final int NXACC_CREATE4 = 4
static final int NXACC_CREATE5 = 5
static final int NXACC_CREATEXML = 6
static final int NXACC_NOSTRIP = 128
static final int NX_UNLIMITED = -1
 constant denoting an unlimited dimension.
static final int NX_FLOAT32 = 5
 constants for number types.
static final int NX_FLOAT64 = 6
static final int NX_INT8 = 20
static final int NX_BINARY = 20
static final int NX_UINT8 = 21
static final int NX_BOOLEAN = 21
static final int NX_INT16 = 22
static final int NX_UINT16 = 23
static final int NX_INT32 = 24
static final int NX_UINT32 = 25
static final int NX_INT64 = 26
static final int NX_UINT64 = 27
static final int NX_CHAR = 4
static final int NX_COMP_NONE = 100
 constants for compression schemes
static final int NX_COMP_LZW = 200
static final int NX_COMP_RLE = 300
static final int NX_COMP_HUF = 400

Protected Member Functions

native int init (String filename, int access)
native void close (int handle)
native int nxflush (int handle)
native void nxmakegroup (int handle, String name, String nxclass)
native void nxopengroup (int handle, String name, String nxclass)
native void nxopenpath (int handle, String path)
native void nxopengrouppath (int handle, String path)
native void nxclosegroup (int handle)
native String nxgetpath (int handle)
native void nxmakedata (int handle, String name, int type, int rank, int dim[])
native void nxmakedata64 (int handle, String name, int type, int rank, long dim[])
native void nxmakecompdata (int handle, String name, int type, int rank, int dim[], int iCompress, int iChunk[])
native void nxmakecompdata64 (int handle, String name, int type, int rank, long dim[], int iCompress, long iChunk[])
native void nxopendata (int handle, String name)
native void nxclosedata (int handle)
native void nxcompress (int handle, int compression_type)
native void nxgetdata (int handle, byte bdata[])
native void nxgetslab (int handle, int Start[], int size[], byte bdata[])
native void nxgetslab64 (int handle, long Start[], long size[], byte bdata[])
native void nxgetattr (int handle, String name, byte bdata[], int args[])
native void nxputdata (int handle, byte array[])
native void nxputslab (int handle, byte array[], int start[], int size[])
native void nxputslab64 (int handle, byte array[], long start[], long size[])
native void nxputattr (int handle, String name, byte array[], int type)
native void nxgetinfo (int handle, int iDim[], int args[])
native void nxgetinfo64 (int handle, long iDim[], int args[])
native void nxsetnumberformat (int handle, int type, String format)
native int nextentry (int handle, String names[])
native int nextattr (int handle, String names[], int args[])
native void initattrdir (int handle)
native void initgroupdir (int handle)
native void nxgetgroupid (int handle, NXlink link)
native void nxgetdataid (int handle, NXlink link)
native void nxmakelink (int handle, NXlink target)
native void nxmakenamedlink (int handle, String name, NXlink target)
native void nxopensourcepath (int handle)
native void nxinquirefile (int handle, String names[])
native void nxlinkexternal (int handle, String name, String nxclass, String nxurl)
native void nxlinkexternaldataset (int handle, String name, String nxurl)
native int nxisexternalgroup (int handle, String name, String nxclass, String nxurl[])
native int nxisexternaldataset (int handle, String name, String nxurl[])

Protected Attributes

int handle
 This is the handle to the NeXus file handle.

Static Protected Attributes

static final int MAXNAMELEN = 64
 Maximum name length, must be VGNAMELENMAX in hlimits.h.

Detailed Description

Definition at line 24 of file NexusFile.java.


Constructor & Destructor Documentation

org.nexusformat.NexusFile.NexusFile ( String  filename,
int  access 
) throws NexusException

constructs a new NexusFile Object.

Parameters:
filenameThe name of the NeXus file to access.
accessThe access mode for the file. Can only be one of the predefined NeXus access code NXACC.... These are:
NXACC_CREATE
or creating a new file.
NXACC_RDWR
For opening an existing file for modification or appending data.
NXACC_READ
For opening a file for reading.
NXACC_NOSTRIP
To keep leading and trailing whitespace on strings
Exceptions:
NexusExceptionwhen the file could not be found or an HDF error occurred.

Definition at line 130 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.init().

Here is the call graph for this function:


Member Function Documentation

Hashtable org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 485 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, org.nexusformat.NexusFile.initattrdir(), org.nexusformat.AttributeEntry.length, and org.nexusformat.NexusFile.nextattr().

Here is the call graph for this function:

native void org.nexusformat.NexusFile.close ( int  handle)
protected
void org.nexusformat.NexusFile.close ( ) throws NexusException

close the NeXus file.

To make javalint and diamond happy

Exceptions:
NexusException

Implements org.nexusformat.NeXusFileInterface.

Definition at line 151 of file NexusFile.java.

References org.nexusformat.NexusFile.handle.

Referenced by org.nexusformat.NexusFile.finalize().

void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 284 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxclosedata().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 211 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxclosegroup().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 226 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, org.nexusformat.NexusFile.NX_COMP_LZW, org.nexusformat.NexusFile.NX_COMP_NONE, and org.nexusformat.NexusFile.nxmakecompdata().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 243 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, org.nexusformat.NexusFile.NX_COMP_LZW, org.nexusformat.NexusFile.NX_COMP_NONE, and org.nexusformat.NexusFile.nxmakecompdata64().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 289 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, org.nexusformat.NexusFile.NX_COMP_HUF, org.nexusformat.NexusFile.NX_COMP_LZW, org.nexusformat.NexusFile.NX_COMP_NONE, org.nexusformat.NexusFile.NX_COMP_RLE, and org.nexusformat.NexusFile.nxcompress().

Here is the call graph for this function:

native void org.nexusformat.NexusFile.debugstop ( )

debugstop is a debugging helper function which goes into an endless loop in the dynamic link library.

Then a unix debugger may attach to the running java process using the pid, interrupt, set the loop variable to leave the loop, set a new breakpoint and continue debugging. This works with ladebug on DU40D. This is an developer support routine and should NEVER be called in normal code.

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

removes all NeXus file data structures and closes the file.

This function should automatically be called by the Java garbage collector whenever the NexusFile object falls into disuse. However the time when this is done is left to the garbage collector. My personal experience is that finalize might never be called. I suggest, to call finalize yourself when you are done with the NeXus file. finalize makes sure that multiple invocations will not do any harm.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 168 of file NexusFile.java.

References org.nexusformat.NexusFile.close().

Here is the call graph for this function:

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

flushes all pending data to disk.

Closes any open SDS's.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 142 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxflush().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 355 of file NexusFile.java.

References ncsa.hdf.hdflib.HDFArray.arrayify(), ncsa.hdf.hdflib.HDFArray.emptyBytes(), ncsa.hdf.hdflib.HDFException.getMessage(), org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxgetattr().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 311 of file NexusFile.java.

References ncsa.hdf.hdflib.HDFArray.arrayify(), ncsa.hdf.hdflib.HDFArray.emptyBytes(), ncsa.hdf.hdflib.HDFException.getMessage(), org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxgetdata().

Here is the call graph for this function:

NXlink org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 518 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxgetdataid().

Here is the call graph for this function:

NXlink org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 511 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxgetgroupid().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 463 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxgetinfo().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 468 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxgetinfo64().

Here is the call graph for this function:

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

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

Returns:
A unix path string

Implements org.nexusformat.NeXusFileInterface.

Definition at line 206 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxgetpath().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 325 of file NexusFile.java.

References ncsa.hdf.hdflib.HDFArray.arrayify(), ncsa.hdf.hdflib.HDFArray.emptyBytes(), ncsa.hdf.hdflib.HDFException.getMessage(), org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxgetslab().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 340 of file NexusFile.java.

References ncsa.hdf.hdflib.HDFArray.arrayify(), ncsa.hdf.hdflib.HDFArray.emptyBytes(), ncsa.hdf.hdflib.HDFException.getMessage(), org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxgetslab64().

Here is the call graph for this function:

Hashtable org.nexusformat.NexusFile.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

Implements org.nexusformat.NeXusFileInterface.

Definition at line 473 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, org.nexusformat.NexusFile.initgroupdir(), and org.nexusformat.NexusFile.nextentry().

Here is the call graph for this function:

native int org.nexusformat.NexusFile.init ( String  filename,
int  access 
)
protected
native void org.nexusformat.NexusFile.initattrdir ( int  handle)
protected
native void org.nexusformat.NexusFile.initgroupdir ( int  handle)
protected
String org.nexusformat.NexusFile.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

Implements org.nexusformat.NeXusFileInterface.

Definition at line 614 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxinquirefile().

Here is the call graph for this function:

String org.nexusformat.NexusFile.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

Implements org.nexusformat.NeXusFileInterface.

Definition at line 646 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxisexternaldataset().

Here is the call graph for this function:

String org.nexusformat.NexusFile.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

Implements org.nexusformat.NeXusFileInterface.

Definition at line 633 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxisexternalgroup().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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

Implements org.nexusformat.NeXusFileInterface.

Definition at line 621 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxlinkexternal().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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

Implements org.nexusformat.NeXusFileInterface.

Definition at line 627 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxlinkexternaldataset().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 260 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxmakedata().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 269 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxmakedata64().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 182 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxmakegroup().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 525 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxmakelink().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 531 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxmakenamedlink().

Here is the call graph for this function:

native int org.nexusformat.NexusFile.nextattr ( int  handle,
String  names[],
int  args[] 
)
protected
native int org.nexusformat.NexusFile.nextentry ( int  handle,
String  names[] 
)
protected
native void org.nexusformat.NexusFile.nxclosedata ( int  handle)
protected
native void org.nexusformat.NexusFile.nxclosegroup ( int  handle)
protected
native void org.nexusformat.NexusFile.nxcompress ( int  handle,
int  compression_type 
)
protected
native int org.nexusformat.NexusFile.nxflush ( int  handle)
protected
native void org.nexusformat.NexusFile.nxgetattr ( int  handle,
String  name,
byte  bdata[],
int  args[] 
)
protected
native void org.nexusformat.NexusFile.nxgetdata ( int  handle,
byte  bdata[] 
)
protected
native void org.nexusformat.NexusFile.nxgetdataid ( int  handle,
NXlink  link 
)
protected
native void org.nexusformat.NexusFile.nxgetgroupid ( int  handle,
NXlink  link 
)
protected
native void org.nexusformat.NexusFile.nxgetinfo ( int  handle,
int  iDim[],
int  args[] 
)
protected
native void org.nexusformat.NexusFile.nxgetinfo64 ( int  handle,
long  iDim[],
int  args[] 
)
protected
native String org.nexusformat.NexusFile.nxgetpath ( int  handle)
protected
native void org.nexusformat.NexusFile.nxgetslab ( int  handle,
int  Start[],
int  size[],
byte  bdata[] 
)
protected
native void org.nexusformat.NexusFile.nxgetslab64 ( int  handle,
long  Start[],
long  size[],
byte  bdata[] 
)
protected
native void org.nexusformat.NexusFile.nxinquirefile ( int  handle,
String  names[] 
)
protected
native int org.nexusformat.NexusFile.nxisexternaldataset ( int  handle,
String  name,
String  nxurl[] 
)
protected
native int org.nexusformat.NexusFile.nxisexternalgroup ( int  handle,
String  name,
String  nxclass,
String  nxurl[] 
)
protected
native void org.nexusformat.NexusFile.nxlinkexternal ( int  handle,
String  name,
String  nxclass,
String  nxurl 
)
protected
native void org.nexusformat.NexusFile.nxlinkexternaldataset ( int  handle,
String  name,
String  nxurl 
)
protected
native void org.nexusformat.NexusFile.nxmakecompdata ( int  handle,
String  name,
int  type,
int  rank,
int  dim[],
int  iCompress,
int  iChunk[] 
)
protected
native void org.nexusformat.NexusFile.nxmakecompdata64 ( int  handle,
String  name,
int  type,
int  rank,
long  dim[],
int  iCompress,
long  iChunk[] 
)
protected
native void org.nexusformat.NexusFile.nxmakedata ( int  handle,
String  name,
int  type,
int  rank,
int  dim[] 
)
protected
native void org.nexusformat.NexusFile.nxmakedata64 ( int  handle,
String  name,
int  type,
int  rank,
long  dim[] 
)
protected
native void org.nexusformat.NexusFile.nxmakegroup ( int  handle,
String  name,
String  nxclass 
)
protected
native void org.nexusformat.NexusFile.nxmakelink ( int  handle,
NXlink  target 
)
protected
native void org.nexusformat.NexusFile.nxmakenamedlink ( int  handle,
String  name,
NXlink  target 
)
protected
native void org.nexusformat.NexusFile.nxopendata ( int  handle,
String  name 
)
protected
native void org.nexusformat.NexusFile.nxopengroup ( int  handle,
String  name,
String  nxclass 
)
protected
native void org.nexusformat.NexusFile.nxopengrouppath ( int  handle,
String  path 
)
protected
native void org.nexusformat.NexusFile.nxopenpath ( int  handle,
String  path 
)
protected
native void org.nexusformat.NexusFile.nxopensourcepath ( int  handle)
protected
native void org.nexusformat.NexusFile.nxputattr ( int  handle,
String  name,
byte  array[],
int  type 
)
protected
native void org.nexusformat.NexusFile.nxputdata ( int  handle,
byte  array[] 
)
protected
native void org.nexusformat.NexusFile.nxputslab ( int  handle,
byte  array[],
int  start[],
int  size[] 
)
protected
native void org.nexusformat.NexusFile.nxputslab64 ( int  handle,
byte  array[],
long  start[],
long  size[] 
)
protected
native void org.nexusformat.NexusFile.nxsetnumberformat ( int  handle,
int  type,
String  format 
)
protected
void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 278 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxopendata().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 188 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxopengroup().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 200 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxopengrouppath().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 194 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxopenpath().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 537 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxopensourcepath().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 428 of file NexusFile.java.

References ncsa.hdf.hdflib.HDFArray.byteify(), ncsa.hdf.hdflib.HDFException.getMessage(), org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxputattr().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 377 of file NexusFile.java.

References ncsa.hdf.hdflib.HDFArray.byteify(), ncsa.hdf.hdflib.HDFException.getMessage(), org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxputdata().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 394 of file NexusFile.java.

References ncsa.hdf.hdflib.HDFArray.byteify(), ncsa.hdf.hdflib.HDFException.getMessage(), org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxputslab().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 411 of file NexusFile.java.

References ncsa.hdf.hdflib.HDFArray.byteify(), ncsa.hdf.hdflib.HDFException.getMessage(), org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxputslab64().

Here is the call graph for this function:

void org.nexusformat.NexusFile.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.

Implements org.nexusformat.NeXusFileInterface.

Definition at line 456 of file NexusFile.java.

References org.nexusformat.NexusFile.handle, and org.nexusformat.NexusFile.nxsetnumberformat().

Here is the call graph for this function:


Member Data Documentation

int org.nexusformat.NexusFile.handle
protected
final int org.nexusformat.NexusFile.MAXNAMELEN = 64
staticprotected

Maximum name length, must be VGNAMELENMAX in hlimits.h.

Definition at line 72 of file NexusFile.java.

final int org.nexusformat.NexusFile.NX_BINARY = 20
static

Definition at line 50 of file NexusFile.java.

final int org.nexusformat.NexusFile.NX_BOOLEAN = 21
static

Definition at line 52 of file NexusFile.java.

final int org.nexusformat.NexusFile.NX_CHAR = 4
static

Definition at line 59 of file NexusFile.java.

final int org.nexusformat.NexusFile.NX_COMP_HUF = 400
static

Definition at line 67 of file NexusFile.java.

Referenced by org.nexusformat.NexusFile.compress().

final int org.nexusformat.NexusFile.NX_COMP_LZW = 200
static
final int org.nexusformat.NexusFile.NX_COMP_NONE = 100
static

constants for compression schemes

See also:
compress

Definition at line 64 of file NexusFile.java.

Referenced by org.nexusformat.NexusFile.compmakedata(), and org.nexusformat.NexusFile.compress().

final int org.nexusformat.NexusFile.NX_COMP_RLE = 300
static

Definition at line 66 of file NexusFile.java.

Referenced by org.nexusformat.NexusFile.compress().

final int org.nexusformat.NexusFile.NX_FLOAT32 = 5
static

constants for number types.

See also:
makedata,
putattr and others.

Definition at line 47 of file NexusFile.java.

final int org.nexusformat.NexusFile.NX_FLOAT64 = 6
static

Definition at line 48 of file NexusFile.java.

final int org.nexusformat.NexusFile.NX_INT16 = 22
static

Definition at line 53 of file NexusFile.java.

final int org.nexusformat.NexusFile.NX_INT32 = 24
static

Definition at line 55 of file NexusFile.java.

final int org.nexusformat.NexusFile.NX_INT64 = 26
static

Definition at line 57 of file NexusFile.java.

final int org.nexusformat.NexusFile.NX_INT8 = 20
static

Definition at line 49 of file NexusFile.java.

final int org.nexusformat.NexusFile.NX_UINT16 = 23
static

Definition at line 54 of file NexusFile.java.

final int org.nexusformat.NexusFile.NX_UINT32 = 25
static

Definition at line 56 of file NexusFile.java.

final int org.nexusformat.NexusFile.NX_UINT64 = 27
static

Definition at line 58 of file NexusFile.java.

final int org.nexusformat.NexusFile.NX_UINT8 = 21
static

Definition at line 51 of file NexusFile.java.

final int org.nexusformat.NexusFile.NX_UNLIMITED = -1
static

constant denoting an unlimited dimension.

Definition at line 41 of file NexusFile.java.

final int org.nexusformat.NexusFile.NXACC_CREATE = 3
static

Definition at line 32 of file NexusFile.java.

final int org.nexusformat.NexusFile.NXACC_CREATE4 = 4
static

Definition at line 33 of file NexusFile.java.

final int org.nexusformat.NexusFile.NXACC_CREATE5 = 5
static

Definition at line 34 of file NexusFile.java.

final int org.nexusformat.NexusFile.NXACC_CREATEXML = 6
static

Definition at line 35 of file NexusFile.java.

final int org.nexusformat.NexusFile.NXACC_NOSTRIP = 128
static

Definition at line 36 of file NexusFile.java.

final int org.nexusformat.NexusFile.NXACC_RDWR = 2
static

Definition at line 31 of file NexusFile.java.

final int org.nexusformat.NexusFile.NXACC_READ = 1
static

possible access codes,

See also:
NexusFile.

Definition at line 30 of file NexusFile.java.


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