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

generated.docs.javadoc.org.eclipse.dawnsci.nexus.NXobject.html Maven / Gradle / Ivy






NXobject (h5jan API)












org.eclipse.dawnsci.nexus

Interface NXobject

    • Method Detail

      • getNXclass

        java.lang.Class<? extends NXobject> getNXclass()
        Java Class object of the interface for this base class, e.g. NXsample.class.
        Returns:
        name of Nexus class
      • getPermittedChildGroupClasses

        java.util.Set<NexusBaseClass> getPermittedChildGroupClasses()
        Returns a set containing the NexusBaseClass constants for the permitted child group types of this base class.
        Returns:
        NexusBaseClass constants for permitted child groups
      • canAddChild

        boolean canAddChild(NXobject nexusObject)
        Returns whether the given NeXus group object can be added as a child group to this base class instance according to the NXDL definition for this base class.
        Parameters:
        nexusObject - potential child nexus group object
        Returns:
        true if the given group object can be added as a child of this base class instance, false otherwise
      • getChild

        <N extends NXobject> N getChild(java.lang.String name,
                                        java.lang.Class<N> nxClass)
        Returns the child of this node of the given type with the given name.
        Parameters:
        name - of child
        nxClass - class of child
        Returns:
        named child NXobject of given NeXus class or null if none
      • getChildren

        <N extends NXobject> java.util.Map<java.lang.String,N> getChildren(java.lang.Class<N> nxClass)
        Returns a map containing all the children of this node of the given class. The keys of the map are the names of the child nodes.
        Parameters:
        nxClass - class of children.
        Returns:
        map of children, key is child node's name
      • getChildren

        java.util.Map<java.lang.String,NXobject> getChildren()
        Returns a map containing all the children of this node. The keys of the map are the names of the child nodes within this NXobject.
        Returns:
        map of children, key is the child node's name
      • setDataset

        DataNode setDataset(java.lang.String name,
                            IDataset value)
        Sets the dataset for the field with the given name
        Parameters:
        name -
        value -
        Returns:
        the new data node, for convenience
      • getDataset

        IDataset getDataset(java.lang.String name)
        Gets the dataset for the field with the given name, if it exists, otherwise null. Note that this method should only be used for small datasets, i.e. those set before the scan. To get the dataset for larger datasets (i.e. data acquired during the scan) use getDataNode(name).getDataset() which returns an ILazyDataset.
        Parameters:
        name - dataset name
        Returns:
        the dataset for the field with the given name, or null if the no such dataset exists
      • initializeLazyDataset

        ILazyWriteableDataset initializeLazyDataset(java.lang.String name,
                                                    int rank,
                                                    java.lang.Class<?> clazz)
        Creates and adds a new ILazyWriteableDataset to this group for the given field name, with the given rank (dimensionality) and of the given element class
        Parameters:
        name - field name
        rank - rank
        clazz - dataset element class
        Returns:
        new lazy writable dataset
      • initializeFixedSizeLazyDataset

        ILazyWriteableDataset initializeFixedSizeLazyDataset(java.lang.String name,
                                                             int[] shape,
                                                             java.lang.Class<?> clazz)
        Creates and adds a new ILazyWriteableDataset to this group for the given field name with the given fixed shape and of the given element class
        Parameters:
        name - field name
        size - the shape
        clazz - dataset element class
        Returns:
        new lazy writable dataset
      • initializeLazyDataset

        ILazyWriteableDataset initializeLazyDataset(java.lang.String name,
                                                    int[] maxShape,
                                                    java.lang.Class<?> clazz)
        Creates and adds a new ILazyWriteableDataset to this group for the given field name, with the given maximum shape and of the given element class
        Parameters:
        name - field name
        maxShape - the maximum shape
        clazz - dataset element class
        Returns:
        new lazy writable dataset
      • createDataNode

        DataNode createDataNode(java.lang.String name,
                                ILazyDataset dataset)
        Creates and adds a new datanode to this group for the given field name and with the given dataset as its value. The given dataset may be either a ILazyWriteableDataset or an IDataset.
        Parameters:
        name - field name
        dataset - dataset
        Returns:
        new data node
      • addExternalLink

        void addExternalLink(java.lang.String name,
                             java.lang.String externalFileName,
                             java.lang.String pathToNode)
        Adds an external link within the given name within this node to the node with the given path within the file with the given name. The external file need not exist at the time this method is invoked.
        Parameters:
        name - name of link within this group
        externalFileName - name of external file to link to
        pathToNode - path of node within external file to link to
      • getLazyWritableDataset

        ILazyWriteableDataset getLazyWritableDataset(java.lang.String name)
        Returns the ILazyWriteableDataset for the field within this object with the given name, or null if no such field exists, or the dataset for this field is not a ILazyWriteableDataset
        Parameters:
        name - field name
        Returns:
        the ILazyWriteableDataset for the given field if it exists, otherwise null
      • setField

        DataNode setField(java.lang.String name,
                          java.lang.Object value)
        Sets the field with the given name to the given value.
        Parameters:
        name - field name
        value - field value
        Returns:
        the newly created DataNode.
      • setAttribute

        void setAttribute(java.lang.String name,
                          java.lang.String attrName,
                          java.lang.Object attrValue)
        Set the value of the given attribute. If the first argument is not null then the attribute is set on the field or child group with this name
        Parameters:
        name - name of node (if null then current group)
        attrName - attribute name
        attrValue - attribute value
      • getDate

        java.util.Date getDate(java.lang.String name)
        Gets the value of the given field as a date.
        Parameters:
        name - name of field
        Returns:
        the value of the given field as a date, null if there is no field with the given name, or the value cannot be parsed as a date
        Throws:
        java.lang.IllegalArgumentException - if the node with the given name is not a DataNode.
      • getNumber

        java.lang.Number getNumber(java.lang.String name)
        Gets the value of the given field as a number, or null if not set.
        Parameters:
        name - name of field
        Returns:
        the value of the given field as a number, null if there is no field with the given name
        Throws:
        java.lang.IllegalArgumentException - if the node with the given name is not a DataNode.
      • getDouble

        java.lang.Double getDouble(java.lang.String name)
        Gets the value of the given field as a Double, or null if not set.
        Parameters:
        name - name of field
        Returns:
        the value of the given field as a double, null if there is no field with the given name
        Throws:
        java.lang.IllegalArgumentException - if the node with the given name is not a DataNode.
      • getLong

        java.lang.Long getLong(java.lang.String name)
        Gets the value of the given field as a long, or null if not set.
        Parameters:
        name - name of field
        Returns:
        the value of the given field as a long, null if there is no field with the given name
        Throws:
        java.lang.IllegalArgumentException - if the node with the given name is not a DataNode.
      • getBoolean

        java.lang.Boolean getBoolean(java.lang.String name)
        Gets the value of the given field as a boolean, or null if not set
        Parameters:
        name - name of field
        Returns:
        the value of the given field as a boolean, null if there is no field with the given name
        Throws:
        java.lang.IllegalArgumentException - if the node with the given name is not a DataNode.
      • getString

        java.lang.String getString(java.lang.String name)
        Gets the value of the given field as a string.
        Parameters:
        name - name of field
        Returns:
        the value of the given field as a string, null if there is no field with the given name
        Throws:
        java.lang.IllegalArgumentException - if the node with the given name is not a DataNode.
      • getAttrDate

        java.util.Date getAttrDate(java.lang.String name,
                                   java.lang.String attrName)
        Get the value of the given attribute as a date. If the first argument is not null then returns the value of attribute of the field or child group with that name.
        Parameters:
        name - name of node (if null then current group)
        attrName - attribute name
        Returns:
        value of attribute as a date, or null if no such attribute or value cannot be parsed as a date
      • getAttrNumber

        java.lang.Number getAttrNumber(java.lang.String name,
                                       java.lang.String attrName)
        Get the value of the given attribute as a number. If the first argument is not null then returns the value of attribute of the field or child group with that name.
        Parameters:
        name - name of node (if null then current group)
        attrName - attribute name
        Returns:
        value of attribute as a number
      • getAttrDouble

        java.lang.Double getAttrDouble(java.lang.String name,
                                       java.lang.String attrName)
        Get the value of the given attribute as a Double, or null if not set. If the first argument is not null then returns the value of attribute of the field or child group with that name.
        Parameters:
        name - name of node (if null then current group)
        attrName - attribute name
        Returns:
        value of attribute as a double
      • getAttrLong

        java.lang.Long getAttrLong(java.lang.String name,
                                   java.lang.String attrName)
        Get the value of the given attribute as a Long, or null if not set. If the first argument is not null then returns the value of attribute of the field or child group with that name.
        Parameters:
        name - name of node (if null then current group)
        attrName - attribute name
        Returns:
        value of attribute as a Long, or null if not set
      • getAttrBoolean

        java.lang.Boolean getAttrBoolean(java.lang.String name,
                                         java.lang.String attrName)
        Get the value of the given attribute as a Boolean, or null if not set. If the first argument is not null then returns the value of attribute of the field or child group with that name.
        Parameters:
        name - name of node (if null then current group)
        attrName - attribute name
        Returns:
        value of attribute as a Boolean, or null if not set
      • getAttrString

        java.lang.String getAttrString(java.lang.String name,
                                       java.lang.String attrName)
        Get the value of the given attribute as a String. If the first argument is not null then returns the value of attribute of the field or child group with that name.
        Parameters:
        name - name of node (if null then current group)
        attrName - attribute name
        Returns:
        value of attribute as a long
      • getAttr

        Dataset getAttr(java.lang.String name,
                        java.lang.String attrName)
        Get the value of the given attribute. If the first argument is not null then returns the value of attribute of the field or child group with that name.
        Parameters:
        name - name of node (if null then current group)
        attrName - attribute name
        Returns:
        value of attribute as a long
      • putChild

        <N extends NXobject> void putChild(java.lang.String name,
                                           N child)
        Add a child node with the given name. This method should be used with caution as it allows a child group to be added that may not be permitted by the NXDL base class definition for this base class. In preference, the relevant set method on the base class specific sub-interface of this interface should be used.
        Parameters:
        name - name of child group
        child - child group
      • setChildren

        <N extends NXobject> void setChildren(java.util.Map<java.lang.String,N> map)
        Adds the child nodes with the given names. This method should be used with caution as it allows a child group to be added that may not be permitted by the NXDL base class definition for this base class. In preference, the relevant set method on the base class specific sub-interface of this interface should be used.
        Parameters:
        map - map from names to child nodes to add
      • getAllDatasets

        java.util.Map<java.lang.String,IDataset> getAllDatasets()
        Returns all datasets as a map keyed by field name
        Returns:
        all datasets




© 2015 - 2024 Weber Informatics LLC | Privacy Policy