Package gda.data.nexus.tree
Interface INexusTree
- All Superinterfaces:
Iterable<INexusTree>,Serializable
- All Known Subinterfaces:
PerScanDataLeaf
- All Known Implementing Classes:
NexusTreeNode,NexusTreeScanDataLeaf,NexusTreeTopNode
-
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a tree as a child node of the current itemgetAttribute(String name) Get an attribute of current nodeGet all attributes of current nodegetChildNode(int index) Get child tree node at position indexgetChildNode(String name, String className) Get child tree node with given name and classgetData()getName()intbooleanvoidRemove tree from collection of child nodes of the current itemvoidsetParentNode(INexusTree parentNode) voidsetPrioritised(INexusTree child) Set that the param tree, which should be a child of this node, should be prioritised over its siblings.voidSet that this NexusTree should be prioritised over its siblings Allows for setting the primary field of the NexusObjectProvider that returns this treevoidsort(Comparator<INexusTree> comparator) toXML(boolean newlineAfterEach, boolean dataAsString) toXMLbegin(boolean newlineAfterEach, boolean dataAsString) toXMLend(boolean newlineAfterEach, boolean dataAsString) Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
getNumberOfChildNodes
int getNumberOfChildNodes()- Returns:
- List of child nodes
-
addChildNode
Add a tree as a child node of the current item- Parameters:
e-
-
removeChildNode
Remove tree from collection of child nodes of the current item- Parameters:
e-
-
getChildNode
Get child tree node at position index- Parameters:
index- - between 0 and getNumberOfChildNodes-1- Returns:
- child node of the current item
-
getChildNode
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
- Parameters:
parentNode-
-
getParentNode
INexusTree getParentNode()- Returns:
- The node of which the current object is a child.
-
toText
- 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
- Parameters:
newlineAfterEach- - if true the output is interspersed with newlines to make it more humanly readabledataAsString- - - 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
- Parameters:
newlineAfterEach-dataAsString-- Returns:
- xml representation of the node and children up to final invalid input: '<'/ > item
-
toXMLend
- Parameters:
newlineAfterEach-dataAsString-- Returns:
- final invalid input: '<'/ > part of an xml representation of the node and children
-
sort
- 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
- Parameters:
nodePath- - format as returned by getNodePath - name_of_top/.../name- Returns:
- node at given path in the tree.
-
getAttribute
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
Set that the param tree, which should be a child of this node, should be prioritised over its siblings.
-