public abstract class DapNode
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,DapAttribute> |
attributes
DAP Attributes attached to this node (as opposed to the xml attributes)
|
protected DapDataset |
dataset |
protected java.lang.String |
escapedname
Escaped version of shortname
|
protected java.lang.String |
fqn
Fully qualified name; note that this is always backslash escaped
|
protected int |
index
Assign unique id to all nodes.
|
protected DapNode |
parent
Parent DapNode; may be:
Group, Structure, Grid, Sequence (for e.g.
|
protected java.lang.String |
shortname
Unqualified (short) name of this node wrt the tree
|
protected DapSort |
sort
Assign a "sort" to this node to avoid
use of instanceof().
|
Constructor and Description |
---|
DapNode() |
DapNode(java.lang.String shortname) |
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(DapAttribute attr) |
DapAttribute |
findAttribute(java.lang.String name) |
java.util.Map<java.lang.String,DapAttribute> |
getAttributes() |
DapNode |
getContainer()
Closest containing group, structure
sequence or Grid.
|
java.util.List<DapNode> |
getContainerPath()
Get the transitive list of containers
Not including this node
|
DapDataset |
getDataset() |
java.lang.String |
getEscapedShortName() |
java.lang.String |
getFQN() |
DapGroup |
getGroup()
Closest containing group
|
java.util.List<DapGroup> |
getGroupPath()
Get the transitive list of containing groups
Possibly including this node
|
int |
getIndex() |
DapNode |
getParent() |
java.util.List<DapNode> |
getPath()
Compute the path to the root dataset.
|
java.lang.String |
getShortName() |
DapSort |
getSort() |
boolean |
isTopLevel() |
void |
removeAttribute(DapAttribute attr)
Used by AbstractDSP to suppress certain attributes.
|
DapAttribute |
setAttribute(DapAttribute attr) |
void |
setAttributes(java.util.Map<java.lang.String,DapAttribute> alist) |
void |
setDataset(DapDataset dataset) |
void |
setIndex(int index) |
void |
setParent(DapNode parent)
Set the parent DapNode; may sometimes be same as container,
but not always (think attributes or maps).
|
void |
setShortName(java.lang.String shortname) |
void |
setSort(DapSort sort) |
java.lang.String |
toString() |
protected DapSort sort
protected int index
protected java.lang.String shortname
protected java.lang.String escapedname
protected DapNode parent
protected DapDataset dataset
protected java.lang.String fqn
protected java.util.Map<java.lang.String,DapAttribute> attributes
public java.util.Map<java.lang.String,DapAttribute> getAttributes()
public void setAttributes(java.util.Map<java.lang.String,DapAttribute> alist)
public DapAttribute setAttribute(DapAttribute attr) throws DapException
DapException
public void addAttribute(DapAttribute attr) throws DapException
DapException
public void removeAttribute(DapAttribute attr) throws DapException
attr
- DapException
public DapAttribute findAttribute(java.lang.String name)
public DapSort getSort()
public void setSort(DapSort sort)
public int getIndex()
public void setIndex(int index)
public DapDataset getDataset()
public void setDataset(DapDataset dataset)
public DapGroup getGroup()
public DapNode getContainer()
public DapNode getParent()
public void setParent(DapNode parent)
parent
- the proposed parent nodepublic java.lang.String getShortName()
public void setShortName(java.lang.String shortname)
public java.lang.String getEscapedShortName()
public java.lang.String getFQN()
public java.util.List<DapNode> getPath()
public java.util.List<DapNode> getContainerPath()
public java.util.List<DapGroup> getGroupPath()
public boolean isTopLevel()
public java.lang.String toString()
toString
in class java.lang.Object