public class HDSDataNode extends DefaultDataNode
| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_CHILDREN_PER_ARRAY
The maximum number of cells of an array of structures to be
considered as its children - more could be unwieldy.
|
| Constructor and Description |
|---|
HDSDataNode(File file)
Constructs an HDSDataNode from the file name of a container file.
|
HDSDataNode(HDSObject hobj)
Constructs an HDSDataNode from an HDSObject.
|
HDSDataNode(String path)
Constructs an HDSDataNode from an HDS path.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
allowsChildren()
Indicates whether this node allows child nodes or not.
|
void |
configureDetail(DetailViewer dv)
No custom configuration is performed.
|
Iterator |
getChildIterator()
Returns the children of this node.
|
Object |
getDataObject(DataType dtype)
The
DefaultDataNode implementation returns any data object
which has been registered using DefaultDataNode.registerDataObject(uk.ac.starlink.datanode.nodes.DataType, java.lang.Object). |
String |
getDescription()
Gets a concise description of this object.
|
protected static HDSObject |
getHDSFromFile(File file) |
protected static HDSObject |
getHDSFromPath(String path) |
String |
getName()
Gets the name of this object.
|
String |
getNodeTLA()
Returns the string "HDS".
|
String |
getNodeType()
Returns a short sentence indicating what kind of node this is.
|
Object |
getParentObject()
Returns an object which is in some sense the parent of the one
this node is based on.
|
String |
getPathElement()
The
DefaultDataNode implementation
returns the label as a default path element. |
String |
getPathSeparator()
Returns a default separator string.
|
boolean |
hasDataObject(DataType dtype)
The
DefaultDataNode implementation returns true for
only those data objects which have been registered using
DefaultDataNode.registerDataObject(uk.ac.starlink.datanode.nodes.DataType, java.lang.Object). |
static boolean |
isMagic(byte[] magic) |
beep, getChildMaker, getCreator, getIcon, getLabel, makeChild, makeErrorChild, registerDataObject, setChildMaker, setCreator, setDescription, setIconID, setLabel, setName, setParentObject, toStringpublic static final int MAX_CHILDREN_PER_ARRAY
public HDSDataNode(HDSObject hobj) throws NoSuchDataException
NoSuchDataExceptionpublic HDSDataNode(File file) throws NoSuchDataException
NoSuchDataExceptionpublic HDSDataNode(String path) throws NoSuchDataException
NoSuchDataExceptionprotected static HDSObject getHDSFromPath(String path) throws NoSuchDataException
NoSuchDataExceptionprotected static HDSObject getHDSFromFile(File file) throws NoSuchDataException
NoSuchDataExceptionpublic boolean allowsChildren()
HDSDataNode may allow children
in two ways: it may either be a scalar structure, in which case
its children will be its components, or it may be an array of
structures, in which case its children will be the elements of
the array. Here the term structure is used in the HDS sense.
We do not consider the elements of an array to be children if the if there are 'too many' elements (more than MAX_CHILDREN_PER_ARRAY). This is arbitrary, but is intended to prevent display getting too unwieldy.
Another possibility would be to allow the elements of an array of primitives to be considered as elements. Following the (sensible) behaviour of HDSTRACE We don't do this.
allowsChildren in interface DataNodeallowsChildren in class DefaultDataNodetrue if the node is of a type which can have
child nodes, false otherwisepublic Iterator getChildIterator()
getChildIterator in interface DataNodegetChildIterator in class DefaultDataNodeDataNodes considered to be the
children of this nodepublic Object getParentObject()
DataNodeDataNode,
it is something which may get fed to a DataNodeFactory
to create DataNode. If no such object exists, which
may well be the case, null should be returned.getParentObject in interface DataNodegetParentObject in class DefaultDataNodenullpublic String getDescription()
DataNodegetName method, since they may be presented together.
It should be on one line, and preferably no longer than around
70 characters. The null value may be returned if
there is nothing to say.getDescription in interface DataNodegetDescription in class DefaultDataNodepublic String getPathElement()
DefaultDataNodeDefaultDataNode implementation
returns the label as a default path element.getPathElement in interface DataNodegetPathElement in class DefaultDataNodepublic String getPathSeparator()
DefaultDataNodegetPathSeparator in interface DataNodegetPathSeparator in class DefaultDataNodepublic String getName()
DataNodegetName in interface DataNodegetName in class DefaultDataNodepublic String getNodeTLA()
getNodeTLA in interface DataNodegetNodeTLA in class DefaultDataNodepublic String getNodeType()
DataNodegetNodeType in interface DataNodegetNodeType in class DefaultDataNodeDataNodepublic void configureDetail(DetailViewer dv)
DefaultDataNodeconfigureDetail in interface DataNodeconfigureDetail in class DefaultDataNodedv - the detail viewer which this node is given an opportunity
to configurepublic boolean hasDataObject(DataType dtype)
DefaultDataNodeDefaultDataNode implementation returns true for
only those data objects which have been registered using
DefaultDataNode.registerDataObject(uk.ac.starlink.datanode.nodes.DataType, java.lang.Object).hasDataObject in interface DataNodehasDataObject in class DefaultDataNodedtype - data object type of interestgetDataObject(type) is likely to be successfulpublic Object getDataObject(DataType dtype) throws DataObjectException
DefaultDataNodeDefaultDataNode implementation returns any data object
which has been registered using DefaultDataNode.registerDataObject(uk.ac.starlink.datanode.nodes.DataType, java.lang.Object).getDataObject in interface DataNodegetDataObject in class DefaultDataNodedtype - data object type of interesttypeDataObjectExceptionpublic static boolean isMagic(byte[] magic)
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.