generated.docs.javadoc.org.eclipse.dawnsci.analysis.tree.impl.GroupNodeImpl.html Maven / Gradle / Ivy
GroupNodeImpl (h5jan API)
org.eclipse.dawnsci.analysis.tree.impl
Class GroupNodeImpl
- java.lang.Object
-
- org.eclipse.dawnsci.analysis.tree.impl.NodeImpl
-
- org.eclipse.dawnsci.analysis.tree.impl.GroupNodeImpl
-
- Direct Known Subclasses:
- NXobjectImpl
public class GroupNodeImpl
extends NodeImpl
implements GroupNode, java.io.Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields
Modifier and Type
Field and Description
protected static long
serialVersionUID
-
Fields inherited from class org.eclipse.dawnsci.analysis.tree.impl.NodeImpl
attributes, id, INDENT
-
Constructor Summary
Constructors
Constructor and Description
GroupNodeImpl(long oid)
Construct a group node with given object ID
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
void
addDataNode(java.lang.String name,
DataNode d)
Add given data node with given path and name
void
addGroupNode(java.lang.String name,
GroupNode g)
Add (child) group node with given path and name
void
addNode(java.lang.String name,
Node node)
Add given node with given path and name
void
addNodeLink(NodeLink link)
Add node link
void
addSymbolicNode(java.lang.String name,
SymbolicNode s)
Add linked node with given path and name
protected void
appendNodeString(java.lang.StringBuilder s,
java.lang.String n)
boolean
containsDataNode(java.lang.String name)
boolean
containsGroupNode(java.lang.String name)
boolean
containsNode(java.lang.String name)
Returns whether this group contains a child node with the given name
boolean
containsSymbolicNode(java.lang.String name)
Returns whether this group node contains a symbolic node of the given name.
protected NodeLink
createNodeLink(java.lang.String name,
Node n)
java.lang.String
findLinkedNodeName(Node node)
Find name of node linked to this group
NodeLink
findNodeLink(java.lang.String pathname)
Recursively find link to node given by path name
DataNode
getDataNode(java.lang.String name)
Get data node of given name.
java.util.Map<java.lang.String,DataNode>
getDataNodeMap()
Get all data nodes, keyed by name within this group node.
java.util.List<DataNode>
getDataNodes()
Get all data nodes.
java.util.List<ILazyDataset>
getDatasets(java.lang.String name)
Recursively find datasets of given name
java.util.Map<java.lang.Long,Node>
getGlobalPool()
GroupNode
getGroupNode(java.lang.String name)
Get (child) group node of given name.
java.util.Map<java.lang.String,GroupNode>
getGroupNodeMap()
Get (child) group nodes, as a map where the key is the name of that group node within
this (parent) group node.
java.util.List<GroupNode>
getGroupNodes()
Get (child) group nodes.
java.util.Collection<java.lang.String>
getNames()
Node
getNode(java.lang.String name)
Returns the child node of the given name, or null
if no such node exists.
NodeLink
getNodeLink(java.lang.String name)
java.util.Iterator<java.lang.String>
getNodeNameIterator()
int
getNumberOfDataNodes()
int
getNumberOfGroupNodes()
int
getNumberOfNodelinks()
SymbolicNode
getSymbolicNode(java.lang.String name)
Get (child) symbolic node of given name.
boolean
isGroupNode()
boolean
isPopulated()
java.util.Iterator<NodeLink>
iterator()
void
removeDataNode(DataNode d)
Remove the given data node from this group.
void
removeDataNode(java.lang.String name)
Remove the data node of given name.
void
removeGroupNode(GroupNode g)
Remove given group node
void
removeGroupNode(java.lang.String name)
Remove group node of given name
void
removeSymbolicNode(java.lang.String name)
Removes the symbolic node with the given name.
void
removeSymbolicNode(SymbolicNode s)
Removes the given symbolic node from this tree.
void
setGlobalPool(java.util.Map<java.lang.Long,Node> globalPool)
Set a reference to the global pool of nodes
java.lang.String
toString()
-
Methods inherited from class org.eclipse.dawnsci.analysis.tree.impl.NodeImpl
addAttribute, containsAttribute, getAttribute, getAttributeIterator, getAttributeNameIterator, getID, getNumberOfAttributes, isDataNode, isSymbolicNode
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.dawnsci.analysis.api.tree.Node
addAttribute, containsAttribute, getAttribute, getAttributeIterator, getAttributeNameIterator, getID, getNumberOfAttributes, isDataNode, isSymbolicNode
-
-
Field Detail
-
serialVersionUID
protected static final long serialVersionUID
- See Also:
- Constant Field Values
-
Constructor Detail
-
GroupNodeImpl
public GroupNodeImpl(long oid)
Construct a group node with given object ID
- Parameters:
oid
- object ID
-
Method Detail
-
setGlobalPool
public void setGlobalPool(java.util.Map<java.lang.Long,Node> globalPool)
Description copied from interface: GroupNode
Set a reference to the global pool of nodes
- Specified by:
setGlobalPool
in interface GroupNode
-
getGlobalPool
public java.util.Map<java.lang.Long,Node> getGlobalPool()
- Specified by:
getGlobalPool
in interface GroupNode
- Returns:
- global pool of cached nodes
-
isPopulated
public boolean isPopulated()
- Specified by:
isPopulated
in interface GroupNode
- Returns:
- true if it has been populated with any nodes
-
getNumberOfNodelinks
public int getNumberOfNodelinks()
- Specified by:
getNumberOfNodelinks
in interface GroupNode
- Returns:
- number of node-links held in group
-
getNodeLink
public NodeLink getNodeLink(java.lang.String name)
- Specified by:
getNodeLink
in interface GroupNode
- Returns:
- node link to child node of given name
-
addNodeLink
public void addNodeLink(NodeLink link)
Description copied from interface: GroupNode
Add node link
- Specified by:
addNodeLink
in interface GroupNode
-
addNode
public void addNode(java.lang.String name,
Node node)
Description copied from interface: GroupNode
Add given node with given path and name
-
getNumberOfGroupNodes
public int getNumberOfGroupNodes()
- Specified by:
getNumberOfGroupNodes
in interface GroupNode
- Returns:
- number of child groups in group
-
containsNode
public boolean containsNode(java.lang.String name)
Description copied from interface: GroupNode
Returns whether this group contains a child node with the given name
- Specified by:
containsNode
in interface GroupNode
- Parameters:
name
- name
- Returns:
true
if this node contains a child node with the given name,
false
otherwise
-
containsGroupNode
public boolean containsGroupNode(java.lang.String name)
- Specified by:
containsGroupNode
in interface GroupNode
- Returns:
- true if group contains child group of given name
-
getGroupNode
public GroupNode getGroupNode(java.lang.String name)
Description copied from interface: GroupNode
Get (child) group node of given name. A SymbolicNode
with the
given name is resolved to its destination node.
- Specified by:
getGroupNode
in interface GroupNode
- Returns:
- group, or
null
if no such group exists
-
getGroupNodes
public java.util.List<GroupNode> getGroupNodes()
Description copied from interface: GroupNode
Get (child) group nodes. Any SymbolicNode
s are resolved to their
destination nodes.
- Specified by:
getGroupNodes
in interface GroupNode
- Returns:
- groups
-
getGroupNodeMap
public java.util.Map<java.lang.String,GroupNode> getGroupNodeMap()
Description copied from interface: GroupNode
Get (child) group nodes, as a map where the key is the name of that group node within
this (parent) group node. Any SymbolicNode
are resolved to their destination nodes.
- Specified by:
getGroupNodeMap
in interface GroupNode
- Returns:
- group node map
-
addGroupNode
public void addGroupNode(java.lang.String name,
GroupNode g)
Description copied from interface: GroupNode
Add (child) group node with given path and name
- Specified by:
addGroupNode
in interface GroupNode
g
- group
-
removeGroupNode
public void removeGroupNode(java.lang.String name)
Description copied from interface: GroupNode
Remove group node of given name
- Specified by:
removeGroupNode
in interface GroupNode
-
removeGroupNode
public void removeGroupNode(GroupNode g)
Description copied from interface: GroupNode
Remove given group node
- Specified by:
removeGroupNode
in interface GroupNode
- Parameters:
g
- group node
-
getNumberOfDataNodes
public int getNumberOfDataNodes()
- Specified by:
getNumberOfDataNodes
in interface GroupNode
- Returns:
- number of data nodes held in group
-
containsDataNode
public boolean containsDataNode(java.lang.String name)
- Specified by:
containsDataNode
in interface GroupNode
- Returns:
- true if group contains data node of given name
-
getDataNode
public DataNode getDataNode(java.lang.String name)
Description copied from interface: GroupNode
Get data node of given name. A SymbolicNode
with the given name is resolved
to its destination node.
- Specified by:
getDataNode
in interface GroupNode
- Returns:
- datanode, or
null
if no such data node exists
-
getDataNodes
public java.util.List<DataNode> getDataNodes()
Description copied from interface: GroupNode
Get all data nodes. Any SymbolicNode
s are resolved to their destination nodes.
- Specified by:
getDataNodes
in interface GroupNode
- Returns:
- data nodes
-
getDataNodeMap
public java.util.Map<java.lang.String,DataNode> getDataNodeMap()
Description copied from interface: GroupNode
Get all data nodes, keyed by name within this group node. Any SymbolicNode
s are
resolved to their destination nodes.
- Specified by:
getDataNodeMap
in interface GroupNode
- Returns:
- data node map
-
getNode
public Node getNode(java.lang.String name)
Description copied from interface: GroupNode
Returns the child node of the given name, or null
if no such node exists.
-
addDataNode
public void addDataNode(java.lang.String name,
DataNode d)
Description copied from interface: GroupNode
Add given data node with given path and name
- Specified by:
addDataNode
in interface GroupNode
d
- dataset
-
removeDataNode
public void removeDataNode(java.lang.String name)
Description copied from interface: GroupNode
Remove the data node of given name.
- Specified by:
removeDataNode
in interface GroupNode
-
removeDataNode
public void removeDataNode(DataNode d)
Description copied from interface: GroupNode
Remove the given data node from this group.
- Specified by:
removeDataNode
in interface GroupNode
- Parameters:
d
- data node
-
addSymbolicNode
public void addSymbolicNode(java.lang.String name,
SymbolicNode s)
Description copied from interface: GroupNode
Add linked node with given path and name
- Specified by:
addSymbolicNode
in interface GroupNode
s
- symbolic link
-
containsSymbolicNode
public boolean containsSymbolicNode(java.lang.String name)
Description copied from interface: GroupNode
Returns whether this group node contains a symbolic node of the given name.
- Specified by:
containsSymbolicNode
in interface GroupNode
- Returns:
true
if group contains a symbolic node of given name,
false
otherwise
-
getSymbolicNode
public SymbolicNode getSymbolicNode(java.lang.String name)
Description copied from interface: GroupNode
Get (child) symbolic node of given name.
- Specified by:
getSymbolicNode
in interface GroupNode
- Returns:
- symbolic node, or
null
if no such node exists
-
removeSymbolicNode
public void removeSymbolicNode(java.lang.String name)
Description copied from interface: GroupNode
Removes the symbolic node with the given name.
- Specified by:
removeSymbolicNode
in interface GroupNode
- Parameters:
name
- name of symbolic node to remove
-
removeSymbolicNode
public void removeSymbolicNode(SymbolicNode s)
Description copied from interface: GroupNode
Removes the given symbolic node from this tree.
- Specified by:
removeSymbolicNode
in interface GroupNode
- Parameters:
s
- symbolic node
-
isGroupNode
public boolean isGroupNode()
- Specified by:
isGroupNode
in interface Node
- Overrides:
isGroupNode
in class NodeImpl
- Returns:
true
if this node is a GroupNode
,
false
otherwise
-
findLinkedNodeName
public java.lang.String findLinkedNodeName(Node node)
Description copied from interface: GroupNode
Find name of node linked to this group
- Specified by:
findLinkedNodeName
in interface GroupNode
- Returns:
- name (or null, if node is not in group)
-
appendNodeString
protected void appendNodeString(java.lang.StringBuilder s,
java.lang.String n)
-
getNodeNameIterator
public java.util.Iterator<java.lang.String> getNodeNameIterator()
- Specified by:
getNodeNameIterator
in interface GroupNode
- Returns:
- iterator over child names in group
-
getDatasets
public java.util.List<ILazyDataset> getDatasets(java.lang.String name)
Description copied from interface: GroupNode
Recursively find datasets of given name
- Specified by:
getDatasets
in interface GroupNode
- Returns:
- list of (unique) datasets
-
findNodeLink
public NodeLink findNodeLink(java.lang.String pathname)
Description copied from interface: GroupNode
Recursively find link to node given by path name
- Specified by:
findNodeLink
in interface GroupNode
- Returns:
- node or null if not found
-
iterator
public java.util.Iterator<NodeLink> iterator()