Package opendap.dap

Class DAPNode

  • All Implemented Interfaces:
    Serializable, Cloneable
    Direct Known Subclasses:
    Attribute, AttributeTable, BaseType, DArrayDimension, PrimitiveVector

    public class DAPNode
    extends Object
    implements Cloneable, Serializable
    The DAPNode class is the common parent type for all nodes in the DDS and the DAS. It is used to manage the following elements. 1. Names - both encoded and clear 2. Cloning - it implements the single clone procedure and converts it to calls to cloneDAG. 3. Parent - this was moved here from BaseType because it (should) represent the only cyclic pointer in the tree. 4. projection - this really only for server nodes. it should be removed when we quit using cloning.
    See Also:
    Serialized Form
    • Field Detail

      • log

        public static org.slf4j.Logger log
      • _nameClear

        protected String _nameClear
        The name of this variable - not www enccoded
      • _nameEncoded

        protected String _nameEncoded
    • Constructor Detail

      • DAPNode

        public DAPNode()
        Constructs a new DAPNode with no name.
      • DAPNode

        public DAPNode​(String n)
        Constructs a new DAPNode with name n. Name is assumed to never be DAP encoded
        Parameters:
        n - the name of the variable.
    • Method Detail

      • setProjected

        public void setProjected​(boolean tf)
      • isProject

        public boolean isProject()
        Check the projection state of this variable. Is the given variable marked as projected? If the variable is listed in the projection part of a constraint expression, then the CE parser should mark it as projected. When this method is called on such a variable it should return true, otherwise it should return false.
        Returns:
        true if the variable is part of the current projections, false otherwise.
      • setProject

        public void setProject​(boolean state,
                               boolean all)
        Set the state of this variable's projection. true means that this variable is part of the current projection as defined by the current constraint expression, otherwise the current projection for this variable should be false.
        Parameters:
        state - true if the variable is part of the current projection, false otherwise.
        all - If true, set the Project property of all the members (and their children, and so on).
      • setProject

        public void setProject​(boolean state)
        Set the state of this variable's projection. true means that this variable is part of the current projection as defined by the current constraint expression, otherwise the current projection for this variable should be false.

        This is equivalent to setProjection(state, true).

        Parameters:
        state - true if the variable is part of the current projection, false otherwise.
      • setParent

        public void setParent​(DAPNode bt)
      • getParent

        public DAPNode getParent()
      • getClearName

        public final String getClearName()
        Returns the unencoded name of the class instance.
        Returns:
        the name of the class instance.
      • getEncodedName

        public final String getEncodedName()
        Returns the WWW encoded name of the class instance.
        Returns:
        the name of the class instance.
      • setEncodedName

        public final void setEncodedName​(String n)
        Sets the name of the class instance.
        Parameters:
        n - the name of the class instance; with escapes
      • setClearName

        public void setClearName​(String n)
        Sets the unencoded name of the class instance.
        Parameters:
        n - the unencoded name of the class instance.
      • clone

        public Object clone()
        Returns a clone of this DAPNode. A deep copy is performed on all data inside the variable.
        Overrides:
        clone in class Object
        Returns:
        a clone of this DAPNode.
      • cloneDAG

        public static DAPNode cloneDAG​(DAPNode.CloneMap map,
                                       DAPNode src)
                                throws CloneNotSupportedException
        This version of cloneDAG() is the primary point of cloning. If the src is already cloned, then that existing clone is immediately returned. Otherwise cloneDAG(map) is called to have the object clone itself. Note this is static because it uses no existing state.
        Parameters:
        map - list of previously cloned nodes
        Returns:
        the clone of the src node
        Throws:
        CloneNotSupportedException