opendap.dap
Class DAPNode

java.lang.Object
  extended by opendap.dap.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.

Version:
$Revision: 22951 $
Author:
dmh (Dennis Heimbigner, Unidata)
See Also:
Serialized Form

Nested Class Summary
static class DAPNode.CloneMap
          Clone interface.
 
Field Summary
protected  String _name
          The name of this variable - not www enccoded
protected  String _nameEncoded
           
 
Constructor Summary
DAPNode()
          Constructs a new DAPNode with no name.
DAPNode(String n)
          Constructs a new DAPNode with name n.
 
Method Summary
 Object clone()
          Returns a clone of this DAPNode.
 DAPNode cloneDAG(DAPNode.CloneMap map)
          This procedure does the actual recursive clone.
static DAPNode cloneDAG(DAPNode.CloneMap map, DAPNode src)
          This version of cloneDAG() is the primary point of cloning.
 String getClearName()
          Returns the unencoded name of the class instance.
 String getEncodedName()
          Returns the WWW encoded name of the class instance.
 DAPNode getParent()
           
 boolean isProject()
          Check the projection state of this variable.
 void setClearName(String n)
          Sets the unencoded name of the class instance.
 void setEncodedName(String n)
          Sets the name of the class instance.
 void setParent(DAPNode bt)
           
 void setProject(boolean state)
          Set the state of this variable's projection.
 void setProject(boolean state, boolean all)
          Set the state of this variable's projection.
 void setProjected(boolean tf)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_name

protected String _name
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.
See Also:
CEEvaluator

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).
See Also:
CEEvaluator

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.
See Also:
CEEvaluator

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

cloneDAG

public DAPNode cloneDAG(DAPNode.CloneMap map)
                 throws CloneNotSupportedException
This procedure does the actual recursive clone.

Parameters:
map - list of previously cloned nodes
Returns:
clone of this node
Throws:
CloneNotSupportedException


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.