/*
 * Created on 15 December 2005, 13:04
 *
 * (C) 2005 Copyright ANSTO. All rights reserved.
 */

package au.gov.ansto.bragg.nexus.base;

import java.beans.PropertyVetoException;

/** Analogous to the NXDataItem 'design class'.
 *
 * <blockquote>
 * Content quoted from  <a href="http://www.nexusformat.org/Design" target="_blank">http://www.nexusformat.org/Design</a>
 * is available under the under the GNU Free Documentation License 1.2 and is quoted
 * <i>in italics.</i>
 * </blockquote>
 *
 * <p>TODO: bind to proper Java units library rather than strings !
 * </p>
 *
 * <p>TODO: java.net.URL not String URL !</p>
 * @author dke
 */
public interface NXdataItem extends NXtyped {
    
    String $UNITLESS = "unitless";
    
    String $units = "units";
    /**
     * <i>
     * Units of data which must conform to the standard
     * defined by the Unidata UDunits utility (in particular, see udunits.dat)
     * </i>
     */
    String getUnits();
    void setUnits(String units);
    //TODO throw InvalidUnitException
    
    //TODO ? does every NXdataItem have units ?
    
    String $checksum = "checksum";
    /** <i>
     * Sum of data array acting as a check on data integrity.
     * </i>
     */
    Integer getChecksum();   //TODO why not just 'int' ?
    void setChecksum(Integer checksum) throws PropertyVetoException;
    
    String $url = "URL";
    /** <i>
     * The URL of the XML DTD file or schema on which the NeXus file is based.
     * Should only be used with the "analysis" data item in an NXentry group.
     * </i>
     *
     * <p>TODO: prefer java.net.URL !</p>
     */
    String getURL();
    void setURL(String url) throws PropertyVetoException;
    
    String $version = "version";
    /** <i>
     * Version of XML DTD file or schema on which the NeXus file is based.
     * Should only be used with the "analysis" data item in an NXentry group.
     * </i>
     */
    String getVersion();
    void setVersion(final String version) throws PropertyVetoException;
    
    String $link = "link";
    /** <i>
     * The Link of the XML DTD file or schema on which the NeXus file is based.
     * Should only be used with the "analysis" data item in an NXentry group.
     * </i>
     */
    String getLink();
    void setLink(String link) throws PropertyVetoException;
    
    //TODO does every NXdataItem have a type
    
    /** Property string for bean property 'type' */
    String $type = "type";
    String getType();
    void setType(String type);
    
}

//TODO ? signal (NXdata.java, NXdetector.Data, NXmonitor.java)
//TODO ? histogram_offset (grep gives no hits anyway)
//TODO ? calibration_status (grep gives no hits anyway)
//TODO ? long_name (NXdetector.Data,..)
//TODO ? primary (NXdetector.?)
//TODO ? axis (NXdetector.?)
//TODO ? axes (NXdetector, NXdata, NXmonitor)

//TODO ! 'link' (NXdetector.Data,..) (though not on Design site)

//TODO ? NXdetector.Crate.local_name

