Package dap4.core.dmr

Class DapNode

    • Field Detail

      • sort

        protected DapSort sort
        Assign a "sort" to this node to avoid use of instanceof().
      • index

        protected int index
        Assign unique id to all nodes. Id is unique relative to the whole tree only. and reflects the order within nodelist
      • shortname

        protected String shortname
        Unqualified (short) name of this node wrt the tree. This is raw (unescaped)
      • escapedname

        protected String escapedname
        Escaped version of shortname
      • parent

        protected DapNode parent
        Parent DapNode; may be: - Group (for e.g. variables, dimensions, and Types), - Structure, Sequence for Fields - Variable (for e.g. attributes or maps).
      • fqn

        protected String fqn
        Fully qualified name; note that this is always backslash escaped
      • attributes

        protected Map<String,​DapAttribute> attributes
        DAP Attributes attached to this node (as opposed to the xml attributes)
      • xmlattributes

        protected Map<String,​String> xmlattributes
        XML Attributes attached to this node. Used to pass reserved extra info to the client.
    • Constructor Detail

      • DapNode

        public DapNode()
      • DapNode

        public DapNode​(String shortname)
    • Method Detail

      • removeAttribute

        public void removeAttribute​(DapAttribute attr)
                             throws DapException
        Used by AbstractDSP to suppress certain attributes.
        Parameters:
        attr -
        Throws:
        DapException
      • getSort

        public DapSort getSort()
      • setSort

        public void setSort​(DapSort sort)
      • getIndex

        public int getIndex()
      • setIndex

        public void setIndex​(int index)
      • setDataset

        public void setDataset​(DapDataset dataset)
      • getGroup

        public DapGroup getGroup()
        Closest containing group
        Returns:
        closest group not equal to this or null if this is a DapDataset
      • getContainer

        public DapNode getContainer()
        Closest containing group, structure, sequence
        Returns:
        closest container
      • getParent

        public DapNode getParent()
      • setParent

        public void setParent​(DapNode parent)
        Set the parent DapNode; may sometimes be same as container, but not always (think attributes or maps). Invariant: parent must be either a group (including DapDataset) or a variable. We can infer the container, so set that also.
        Parameters:
        parent - the proposed parent node
      • overrideParent

        public void overrideParent​(DapNode parent)
        Same as setparent except existing parent can be non-null
        Parameters:
        parent - the proposed parent node
      • getShortName

        public String getShortName()
      • setShortName

        public void setShortName​(String shortname)
      • getEscapedShortName

        public String getEscapedShortName()
        Here, escaped means backslash escaped short name
        Returns:
        escaped name
      • getFQN

        public String getFQN()
      • getPath

        public List<DapNode> getPath()
        Compute the path upto, and including the root Dataset. This node is included as last element in path.
        Returns:
        ordered list of parent nodes
      • getContainerPath

        public List<DapNode> getContainerPath()
        Get the transitive list of containers Not including this node
        Returns:
        list of container nodes
      • getGroupPath

        public List<DapGroup> getGroupPath()
        Get the transitive list of containing groups Possibly including this node
        Returns:
        list of group nodes
      • computefqn

        public String computefqn()
        Compute the FQN of this node
      • isTopLevel

        public boolean isTopLevel()