Package opendap.dap
Class DAPNode
- java.lang.Object
-
- 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.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DAPNode.CloneMap
Clone interface.
-
Field Summary
Fields Modifier and Type Field Description protected String
_nameClear
The name of this variable - not www enccodedprotected String
_nameEncoded
static org.slf4j.Logger
log
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
clone()
Returns a clone of thisDAPNode
.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)
-
-
-
Constructor Detail
-
DAPNode
public DAPNode()
Constructs a newDAPNode
with no name.
-
DAPNode
public DAPNode(String n)
Constructs a newDAPNode
with namen
. 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 returntrue
, otherwise it should returnfalse
.- 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 befalse
.- Parameters:
state
-true
if the variable is part of the current projection,false
otherwise.all
- Iftrue
, 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 befalse
.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 thisDAPNode
. A deep copy is performed on all data inside the variable.
-
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
-
-