Interface NXobject

All Superinterfaces:
GroupNode, Iterable<NodeLink>, Node
All Known Subinterfaces:
NXaberration, NXactivity, NXactuator, NXaperture, NXapm_charge_state_analysis, NXapm_event_data, NXapm_instrument, NXapm_measurement, NXapm_paraprobe_tool_common, NXapm_paraprobe_tool_parameters, NXapm_paraprobe_tool_process, NXapm_ranging, NXapm_reconstruction, NXapm_simulation, NXatom, NXattenuator, NXbeam, NXbeam_splitter, NXbeam_stop, NXbeam_transfer_matrix_table, NXbending_magnet, NXcalibration, NXcapillary, NXcg_alpha_complex, NXcg_cylinder, NXcg_ellipsoid, NXcg_face_list_data_structure, NXcg_grid, NXcg_half_edge_data_structure, NXcg_hexahedron, NXcg_parallelogram, NXcg_point, NXcg_polygon, NXcg_polyhedron, NXcg_polyline, NXcg_primitive, NXcg_roi, NXcg_tetrahedron, NXcg_triangle, NXcg_unit_normal, NXchemical_composition, NXcircuit, NXcite, NXcollection, NXcollectioncolumn, NXcollimator, NXcomponent, NXcontainer, NXcoordinate_system, NXcorrector_cs, NXcrystal, NXcs_computer, NXcs_filter_boolean_mask, NXcs_memory, NXcs_prng, NXcs_processor, NXcs_profiling, NXcs_profiling_event, NXcs_storage, NXcsg, NXcylindrical_geometry, NXdata, NXdeflector, NXdelocalization, NXdetector, NXdetector_channel, NXdetector_group, NXdetector_module, NXdisk_chopper, NXdispersion, NXdispersion_function, NXdispersion_repeated_parameter, NXdispersion_single_parameter, NXdispersion_table, NXdistortion, NXebeam_column, NXelectromagnetic_lens, NXelectron_detector, NXelectronanalyzer, NXelectrostatic_kicker, NXem_ebsd, NXem_eds, NXem_eels, NXem_event_data, NXem_img, NXem_instrument, NXem_interaction_volume, NXem_measurement, NXem_optical_system, NXem_simulation, NXenergydispersion, NXentry, NXenvironment, NXevent_data, NXfabrication, NXfermi_chopper, NXfilter, NXfit, NXfit_function, NXflipper, NXfresnel_zone_plate, NXgeometry, NXgrating, NXguide, NXhistory, NXibeam_column, NXimage, NXinsertion_device, NXinstrument, NXisocontour, NXlog, NXmagnetic_kicker, NXmanipulator, NXmatch_filter, NXmicrostructure, NXmicrostructure_feature, NXmicrostructure_ipf, NXmicrostructure_mtex_config, NXmicrostructure_odf, NXmicrostructure_pf, NXmicrostructure_slip_system, NXmirror, NXmoderator, NXmonitor, NXmonochromator, NXnote, NXoff_geometry, NXoptical_fiber, NXoptical_lens, NXoptical_polarizer, NXoptical_window, NXorientation, NXparameters, NXpdb, NXpeak, NXphase, NXpid_controller, NXpinhole, NXpolarizer, NXpositioner, NXprocess, NXprogram, NXpump, NXquadric, NXquadrupole_magnet, NXreflections, NXregion, NXregistration, NXresolution, NXroi_process, NXroot, NXrotations, NXsample, NXsample_component, NXscan_controller, NXsensor, NXseparator, NXshape, NXsimilarity_grouping, NXslit, NXsolenoid_magnet, NXsolid_geometry, NXsource, NXspatial_filter, NXspectrum, NXspin_rotator, NXspindispersion, NXsubentry, NXsubsampling_filter, NXsubstance, NXtransformations, NXtranslation, NXunit_cell, NXuser, NXvelocity_selector, NXwaveplate, NXxraylens

public interface NXobject extends GroupNode
Base interface of all Nexus group nodes
  • Field Details

  • Method Details

    • getNXclass

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

      NexusBaseClass getNexusBaseClass()
      Enum constant from NexusBaseClass for this base class, e.g. NexusBaseClass.NX_SAMPLE.
      Returns:
      NexusBaseClass enum constant for this class
    • getPermittedChildGroupClasses

      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(String name, 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> Map<String,N> getChildren(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

      Map<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(String name, org.eclipse.january.dataset.IDataset value)
      Sets the dataset for the field with the given name
      Parameters:
      name -
      value -
      Returns:
      the new data node, for convenience
    • getDataset

      org.eclipse.january.dataset.Dataset getDataset(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
      Throws:
      IllegalStateException - if the dataset is too large to load into memory
    • getLazyDataset

      org.eclipse.january.dataset.ILazyDataset getLazyDataset(String name)
      Gets the dataset for the field with the given name, if it exists, otherwise null. This method will work for all kinds of dataset as ILazyDataset is the common superinterface for dataset. The type of dataset may be a Dataset for an in-memory dataset, an ILazyDataset for a dataset to be read from a file, or an ILazyWriteableDataset for a dataset intended to be written to during the scan.
      Parameters:
      name - dataset name
      Returns:
      the ILazyDataset for the given name
    • initializeLazyDataset

      org.eclipse.january.dataset.ILazyWriteableDataset initializeLazyDataset(String name, int rank, 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

      org.eclipse.january.dataset.ILazyWriteableDataset initializeFixedSizeLazyDataset(String name, int[] shape, 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
      clazz - dataset element class
      size - shape
      Returns:
      new lazy writable dataset
    • initializeLazyDataset

      org.eclipse.january.dataset.ILazyWriteableDataset initializeLazyDataset(String name, int[] maxShape, 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 - maximum shape
      clazz - dataset element class
      Returns:
      new lazy writable dataset
    • initializeLazyDataset

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

      DataNode createDataNode(String name, org.eclipse.january.dataset.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(String name, String externalFileName, 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

      org.eclipse.january.dataset.ILazyWriteableDataset getLazyWritableDataset(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(String name, 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(String name, String attrName, 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

      Date getDate(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:
      IllegalArgumentException - if the node with the given name is not a DataNode.
    • getNumber

      Number getNumber(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:
      IllegalArgumentException - if the node with the given name is not a DataNode.
    • getDouble

      Double getDouble(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:
      IllegalArgumentException - if the node with the given name is not a DataNode.
    • getLong

      Long getLong(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:
      IllegalArgumentException - if the node with the given name is not a DataNode.
    • getBoolean

      Boolean getBoolean(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:
      IllegalArgumentException - if the node with the given name is not a DataNode.
    • getString

      String getString(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:
      IllegalArgumentException - if the node with the given name is not a DataNode.
    • getAttrDate

      Date getAttrDate(String name, 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

      Number getAttrNumber(String name, 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

      Double getAttrDouble(String name, 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

      Long getAttrLong(String name, 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

      Boolean getAttrBoolean(String name, 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

      String getAttrString(String name, 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

      org.eclipse.january.dataset.Dataset getAttr(String name, 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(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(Map<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

      Map<String,org.eclipse.january.dataset.Dataset> getAllDatasets()
      Returns all datasets as a map keyed by field name
      Returns:
      all datasets
    • getAttributeDefault

      String getAttributeDefault()
      .. index:: find the default plottable data .. index:: plotting .. index:: default attribute value Declares which :ref:`NXdata` group contains the data to be shown by default. It is used to resolve ambiguity when one :ref:`NXdata` group exists. The value :ref:`names ` a child group. If that group itself has a ``default`` attribute, continue this chain until an :ref:`NXdata` group is reached. For more information about how NeXus identifies the default plottable data, see the :ref:`Find Plottable Data, v3 invalid input: '<'Find-Plottable-Data-v3>` section.
      Returns:
      the value.
    • setAttributeDefault

      void setAttributeDefault(String defaultValue)
      .. index:: find the default plottable data .. index:: plotting .. index:: default attribute value Declares which :ref:`NXdata` group contains the data to be shown by default. It is used to resolve ambiguity when one :ref:`NXdata` group exists. The value :ref:`names ` a child group. If that group itself has a ``default`` attribute, continue this chain until an :ref:`NXdata` group is reached. For more information about how NeXus identifies the default plottable data, see the :ref:`Find Plottable Data, v3 invalid input: '<'Find-Plottable-Data-v3>` section.
      Parameters:
      defaultValue - the defaultValue