public abstract class DapNode
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.Object,java.lang.Object> |
annotations |
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 (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().
|
protected java.util.Map<java.lang.String,java.lang.String> |
xmlattributes
XML Attributes attached to this node.
|
Constructor and Description |
---|
DapNode() |
DapNode(java.lang.String shortname) |
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(DapAttribute attr) |
void |
addXMLAttribute(java.lang.String name,
java.lang.String value) |
DapNode |
annotate(java.lang.Object id,
java.lang.Object value) |
java.lang.Object |
annotation(java.lang.Object id) |
java.lang.String |
computefqn()
Compute the FQN of this node
|
DapAttribute |
findAttribute(java.lang.String name) |
java.util.Map<java.lang.String,DapAttribute> |
getAttributes() |
DapNode |
getContainer()
Closest containing group, structure, sequence
|
java.util.List<DapNode> |
getContainerPath()
Get the transitive list of containers
Not including this node
|
DapDataset |
getDataset() |
java.lang.String |
getEscapedShortName()
Here, escaped means backslash escaped short name
|
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 upto, and including the root Dataset.
|
java.lang.String |
getShortName() |
DapSort |
getSort() |
java.util.Map<java.lang.String,java.lang.String> |
getXMLAttributes() |
boolean |
isTopLevel() |
void |
overrideParent(DapNode parent)
Same as setparent except existing parent can be non-null
|
void |
removeAttribute(DapAttribute attr)
Used by AbstractDSP to suppress certain attributes.
|
void |
removeXMLAttribute(java.lang.String name) |
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
protected java.util.Map<java.lang.String,java.lang.String> xmlattributes
protected java.util.Map<java.lang.Object,java.lang.Object> annotations
public DapNode annotate(java.lang.Object id, java.lang.Object value)
public java.lang.Object annotation(java.lang.Object id)
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 java.util.Map<java.lang.String,java.lang.String> getXMLAttributes()
public void addXMLAttribute(java.lang.String name, java.lang.String value) throws DapException
DapException
public void removeXMLAttribute(java.lang.String name) throws DapException
DapException
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 void overrideParent(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 java.lang.String computefqn()
public boolean isTopLevel()
public java.lang.String toString()
toString
in class java.lang.Object