Interface INexusTree

All Superinterfaces:
Iterable<INexusTree>, Serializable
All Known Subinterfaces:
PerScanDataLeaf
All Known Implementing Classes:
NexusTreeNode, NexusTreeScanDataLeaf, NexusTreeTopNode

public interface INexusTree extends Iterable<INexusTree>, Serializable
  • Method Details

    • getNumberOfChildNodes

      int getNumberOfChildNodes()
      Returns:
      List of child nodes
    • addChildNode

      void addChildNode(INexusTree e)
      Add a tree as a child node of the current item
      Parameters:
      e -
    • removeChildNode

      void removeChildNode(INexusTree e)
      Remove tree from collection of child nodes of the current item
      Parameters:
      e -
    • getChildNode

      INexusTree getChildNode(int index)
      Get child tree node at position index
      Parameters:
      index - - between 0 and getNumberOfChildNodes-1
      Returns:
      child node of the current item
    • getChildNode

      INexusTree getChildNode(String name, String className)
      Get child tree node with given name and class
      Parameters:
      name -
      className -
      Returns:
      child node of the current item
    • getName

      String getName()
      Returns:
      The name of the element as stored as a group name in Nexus
    • getNxClass

      String getNxClass()
      Returns:
      The class of the element as stored as a group class in Nexus
    • getData

      NexusGroupData getData()
      Returns:
      Nexus data associated with the node - null if not present
    • setParentNode

      void setParentNode(INexusTree parentNode)
      Parameters:
      parentNode -
    • getParentNode

      INexusTree getParentNode()
      Returns:
      The node of which the current object is a child.
    • toText

      String toText(String prefix, String keyValueSep, String dataItemSep, String nodeSep)
      Parameters:
      prefix - Text that begins each line e.g. ""
      keyValueSep - Text between key and value e.g. ":"
      dataItemSep - Text between key and data e.g. "="
      nodeSep - Text between nodes e.g. "|"
      Returns:
      A string that represents the tree in text format e.g. NXextry:NXinstrument:name=
    • toText

      String toText(String prefix, String keyValueSep, String dataItemSep, String nodeSep, boolean includeData)
      Parameters:
      prefix - Text that begins each line e.g. ""
      keyValueSep - Text between key and value e.g. ":"
      dataItemSep - Text between key and data e.g. "="
      nodeSep - Text between nodes e.g. "|"
      includeData - Whether to include the data in the output
      Returns:
      A string that represents the tree in text format e.g. NXextry:NXinstrument:name=
    • toXML

      String toXML(boolean newlineAfterEach, boolean dataAsString)
      Parameters:
      newlineAfterEach - - if true the output is interspersed with newlines to make it more humanly readable
      dataAsString - - - if true data array are written as string. NX_CHAR data is always shown as a string
      Returns:
      A string that represents the tree in xml
    • toXMLbegin

      StringBuilder toXMLbegin(boolean newlineAfterEach, boolean dataAsString)
      Parameters:
      newlineAfterEach -
      dataAsString -
      Returns:
      xml representation of the node and children up to final invalid input: '<'/ > item
    • toXMLend

      StringBuilder toXMLend(boolean newlineAfterEach, boolean dataAsString)
      Parameters:
      newlineAfterEach -
      dataAsString -
      Returns:
      final invalid input: '<'/ > part of an xml representation of the node and children
    • sort

      void sort(Comparator<INexusTree> comparator)
      Parameters:
      comparator -
    • isPointDependent

      boolean isPointDependent()
      Returns:
      true if the data can vary during a scan
    • getNodePath

      String getNodePath()
      Returns:
      unique id of item in the tree - name_of_top/.../name
    • getNodePathWithClasses

      String getNodePathWithClasses()
      Returns:
      unique id of item in the tree - name_of_top/class_of_top/.../name/class
    • getNode

      INexusTree getNode(String nodePath)
      Parameters:
      nodePath - - format as returned by getNodePath - name_of_top/.../name
      Returns:
      node at given path in the tree.
    • getAttribute

      Serializable getAttribute(String name)
      Get an attribute of current node
      Parameters:
      name -
      Returns:
      an attribute with given name or null if not found
    • getAttributes

      Map<String,Serializable> getAttributes()
      Get all attributes of current node
      Returns:
      a Map of attributes
    • setPriority

      void setPriority()
      Set that this NexusTree should be prioritised over its siblings Allows for setting the primary field of the NexusObjectProvider that returns this tree
    • setPrioritised

      void setPrioritised(INexusTree child)
      Set that the param tree, which should be a child of this node, should be prioritised over its siblings.