All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.jhdf.CommittedDatatype Maven / Gradle / Ivy

There is a newer version: 0.9.4
Show newest version
/*
 * This file is part of jHDF. A pure Java library for accessing HDF5 files.
 *
 * https://jhdf.io
 *
 * Copyright (c) 2025 James Mudd
 *
 * MIT License see 'LICENSE' file
 */
package io.jhdf;

import io.jhdf.api.Group;
import io.jhdf.api.NodeType;
import io.jhdf.exceptions.HdfException;
import io.jhdf.object.datatype.DataType;
import io.jhdf.object.message.DataTypeMessage;
import io.jhdf.storage.HdfBackingStorage;
import org.apache.commons.lang3.concurrent.ConcurrentException;

public class CommittedDatatype extends AbstractNode {

	public CommittedDatatype(HdfBackingStorage hdfBackingStorage, long address, String name, Group parent) {
		super(hdfBackingStorage, address, name, parent);
	}

	@Override
	public NodeType getType() {
		return NodeType.COMMITTED_DATATYPE;
	}

	public DataType getDataType() {
		try {
			return header.get().getMessageOfType(DataTypeMessage.class).getDataType();
		} catch (ConcurrentException e) {
			throw new HdfException("Failed to get data type from committed datatype [" + getPath() + "]");
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy