Logo Search packages:      
Sourcecode: jhdf version File versions  Download package

void ncsa::hdf::object::h5::H5ScalarDS::writeMetadata ( Object  info  )  throws Exception [inline, virtual]

Writes a specific metadata (such as attribute) into file.

If metadata exists, the method updates its value. If the metadata does not exists in file, it creates the metadata in file and attaches it to the object.

info the metadata to write.

Implements ncsa::hdf::object::DataFormat.

Definition at line 840 of file H5ScalarDS.java.

References attributeList, ncsa::hdf::object::HObject::getFileFormat(), getMetadata(), ncsa::hdf::object::Attribute::getName(), and ncsa::hdf::object::FileFormat::writeAttribute().

Referenced by test::unittests::H5ScalarDSTest::testRemoveMetadata(), and test::unittests::H5ScalarDSTest::testWriteMetadata().

        // only attribute metadata is supported.
        if (!(info instanceof Attribute)) {

        boolean attrExisted = false;
        Attribute attr = (Attribute)info;
        String name = attr.getName();

        if (attributeList == null) {
        } else {
            attrExisted = attributeList.contains(attr);

        getFileFormat().writeAttribute(this, attr, attrExisted);

        // add the new attribute into attribute list
        if (!attrExisted) {
            nAttributes = attributeList.size();

Generated by  Doxygen 1.6.0   Back to index