|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.datanode.nodes.DefaultDataNode
uk.ac.starlink.datanode.nodes.HDSDataNode
public class HDSDataNode
A DataNode
representing an
HDS
object.
Field Summary | |
---|---|
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 Summary | |
---|---|
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. |
Method Summary | |
---|---|
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)
|
Methods inherited from class uk.ac.starlink.datanode.nodes.DefaultDataNode |
---|
beep, getChildMaker, getCreator, getIcon, getLabel, makeChild, makeErrorChild, registerDataObject, setChildMaker, setCreator, setDescription, setIconID, setLabel, setName, setParentObject, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MAX_CHILDREN_PER_ARRAY
Constructor Detail |
---|
public HDSDataNode(HDSObject hobj) throws NoSuchDataException
NoSuchDataException
public HDSDataNode(File file) throws NoSuchDataException
NoSuchDataException
public HDSDataNode(String path) throws NoSuchDataException
NoSuchDataException
Method Detail |
---|
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
getParentObject
in interface DataNode
getParentObject
in class DefaultDataNode
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
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.registerDataObject(uk.ac.starlink.datanode.nodes.DataType, java.lang.Object)
.
hasDataObject
in interface DataNode
hasDataObject
in class DefaultDataNode
dtype
- data object type of interest
public Object getDataObject(DataType dtype) throws DataObjectException
DefaultDataNode
DefaultDataNode.registerDataObject(uk.ac.starlink.datanode.nodes.DataType, java.lang.Object)
.
getDataObject
in interface DataNode
getDataObject
in class DefaultDataNode
dtype
- data object type of interest
DataObjectException
public static boolean isMagic(byte[] magic)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |