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, toString
public static final int MAX_CHILDREN_PER_ARRAY
public HDSDataNode(HDSObject hobj) throws NoSuchDataException
NoSuchDataException
public HDSDataNode(File file) throws NoSuchDataException
NoSuchDataException
public HDSDataNode(String path) throws NoSuchDataException
NoSuchDataException
protected static HDSObject getHDSFromPath(String path) throws NoSuchDataException
NoSuchDataException
protected static HDSObject getHDSFromFile(File file) throws NoSuchDataException
NoSuchDataException
public 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 DataNode
allowsChildren
in class DefaultDataNode
true
if the node is of a type which can have
child nodes, false
otherwisepublic Iterator getChildIterator()
getChildIterator
in interface DataNode
getChildIterator
in class DefaultDataNode
DataNode
s considered to be the
children of this nodepublic Object getParentObject()
DataNode
DataNode
,
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 DataNode
getParentObject
in class DefaultDataNode
null
public String getDescription()
DataNode
getName
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 DataNode
getDescription
in class DefaultDataNode
public String getPathElement()
DefaultDataNode
DefaultDataNode
implementation
returns the label as a default path element.getPathElement
in interface DataNode
getPathElement
in class DefaultDataNode
public String getPathSeparator()
DefaultDataNode
getPathSeparator
in interface DataNode
getPathSeparator
in class DefaultDataNode
public String getName()
DataNode
getName
in interface DataNode
getName
in class DefaultDataNode
public String getNodeTLA()
getNodeTLA
in interface DataNode
getNodeTLA
in class DefaultDataNode
public String getNodeType()
DataNode
getNodeType
in interface DataNode
getNodeType
in class DefaultDataNode
DataNode
public void configureDetail(DetailViewer dv)
DefaultDataNode
configureDetail
in interface DataNode
configureDetail
in class DefaultDataNode
dv
- the detail viewer which this node is given an opportunity
to configurepublic boolean hasDataObject(DataType dtype)
DefaultDataNode
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)
.hasDataObject
in interface DataNode
hasDataObject
in class DefaultDataNode
dtype
- data object type of interestgetDataObject(type)
is likely to be successfulpublic Object getDataObject(DataType dtype) throws DataObjectException
DefaultDataNode
DefaultDataNode
implementation returns any data object
which has been registered using DefaultDataNode.registerDataObject(uk.ac.starlink.datanode.nodes.DataType, java.lang.Object)
.getDataObject
in interface DataNode
getDataObject
in class DefaultDataNode
dtype
- data object type of interesttype
DataObjectException
public static boolean isMagic(byte[] magic)
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.