public class H5Link extends HObject implements MetaDataContainer
H5Link object is an HDF5 object that is either a soft or an external link to an object in a file that does not exist. The type of the object is unknown. Once the object being linked to is created, and the type is known, then H5link object will change its type.
fileFormat, linkTargetObjName, oid, separator
Constructor and Description |
---|
H5Link(FileFormat theFile,
String name,
String path)
Constructs an HDF5 link with specific name, path, and parent.
|
H5Link(FileFormat theFile,
String theName,
String thePath,
long[] oid) |
Modifier and Type | Method and Description |
---|---|
void |
close(long id)
Closes access to the object.
|
List |
getMetadata()
Retrieves the object's metadata, such as attributes, from the file.
|
List |
getMetadata(int... attrPropList) |
boolean |
hasAttribute()
Check if the object has any attributes attached.
|
long |
open()
Opens an existing object such as a dataset or group for access.
|
void |
removeMetadata(Object info)
Deletes an existing piece of metadata from this object.
|
void |
setName(String newName)
Sets the name of the object.
|
void |
updateMetadata(Object info)
Updates an existing piece of metadata attached to this object.
|
void |
writeMetadata(Object info)
Writes a specific piece of metadata (such as an attribute) into the file.
|
debug, equals, equalsOID, getFID, getFile, getFileFormat, getFullName, getLinkTargetObjName, getName, getOID, getPath, setLinkTargetObjName, setPath, toString
public H5Link(FileFormat theFile, String name, String path)
theFile
- the file which containing the link.name
- the name of this link, e.g. "link1".path
- the full path of this link, e.g. "/groups/".public H5Link(FileFormat theFile, String theName, String thePath, long[] oid)
public void close(long id)
HObject
Sub-classes must implement this interface because different data objects have their own ways of how the data resources are closed.
For example, H5Group.close() calls the hdf.hdf5lib.H5.H5Gclose() method and closes the group resource specified by the group id.
public long open()
HObject
open
in class HObject
HObject.close(long)
public List getMetadata() throws Exception
MetaDataContainer
Metadata, such as attributes, is stored in a List.
getMetadata
in interface MetaDataContainer
Exception
- if the metadata can not be retrievedpublic boolean hasAttribute()
MetaDataContainer
hasAttribute
in interface MetaDataContainer
public void removeMetadata(Object info) throws Exception
MetaDataContainer
removeMetadata
in interface MetaDataContainer
info
- the metadata to delete.Exception
- if the metadata can not be removedpublic void writeMetadata(Object info) throws Exception
MetaDataContainer
writeMetadata
in interface MetaDataContainer
info
- the metadata to write.Exception
- if the metadata can not be writtenpublic void updateMetadata(Object info) throws Exception
MetaDataContainer
updateMetadata
in interface MetaDataContainer
info
- the metadata to update.Exception
- if the metadata can not be updatedpublic List getMetadata(int... attrPropList) throws Exception
Exception
Copyright © 2018. All Rights Reserved.