public abstract class CDMNode
extends java.lang.Object
CDMSort
so that we can
1. do true switching on node type
2. avoid use of instanceof
3. Use container classes that have more than one kind of node
Also move various common fields and methods to here.
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.lang.String,java.lang.Object> |
annotations |
protected java.lang.String |
dodsname |
protected Group |
group |
protected boolean |
immutable |
protected Structure |
parentstruct |
protected java.lang.String |
shortName |
protected CDMSort |
sort |
Modifier | Constructor and Description |
---|---|
protected |
CDMNode() |
|
CDMNode(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
annotate(java.lang.String key,
java.lang.Object value) |
java.lang.Object |
getAnnotation(java.lang.String key) |
java.util.Map<java.lang.String,java.lang.Object> |
getAnnotations() |
java.lang.String |
getDODSName()
Get the dodsname
|
java.lang.String |
getFullName()
Get the Full name of this object.
|
java.lang.String |
getFullNameEscaped()
Alias for getFullName
|
Group |
getGroup()
Alias for getParentGroup
|
boolean |
getImmutable()
Get immutable flag
As a rule, subclasses will access directly
|
java.lang.String |
getName()
Deprecated.
Replaced by
getShortName() and getFullName() |
Group |
getParentGroup()
Get its parent Group, or null if its the root group.
|
Structure |
getParentStructure()
Get its parent structure, or null if not in structure
|
java.lang.String |
getShortName()
Get the short name of this Variable.
|
CDMSort |
getSort() |
abstract void |
hashCodeShow(Indent indent) |
boolean |
isMemberOfStructure()
Test for presence of parent Structure
|
int |
localhash() |
void |
setDODSName(java.lang.String name)
Store the original dods name
|
void |
setImmutable(boolean tf)
Set the immutable flag
|
void |
setParentGroup(Group parent)
Set the parent Group
|
void |
setParentStructure(Structure parent)
Set the parent Structure
|
void |
setShortName(java.lang.String name)
Set the short name of this Variable.
|
void |
setSort(CDMSort sort) |
static CDMNode |
unwrap(CDMNode node)
NetcdfDataset can end up wrapping a variable
in multiple wrapping classes (e.g.
|
protected CDMSort sort
protected Group group
protected Structure parentstruct
protected boolean immutable
protected java.lang.String shortName
protected java.util.Map<java.lang.String,java.lang.Object> annotations
protected java.lang.String dodsname
public CDMSort getSort()
public void setSort(CDMSort sort)
public java.lang.String getShortName()
public void setShortName(java.lang.String name)
name
- new short namepublic Group getParentGroup()
public Group getGroup()
public void setParentGroup(Group parent)
parent
- The new parent grouppublic Structure getParentStructure()
public void setParentStructure(Structure parent)
parent
- The new parent structurepublic boolean isMemberOfStructure()
public boolean getImmutable()
public void setImmutable(boolean tf)
tf
- The new value for the immutable flagpublic java.lang.String getDODSName()
public void setDODSName(java.lang.String name)
name
- The original name from the DDS/DASpublic java.lang.String getFullName()
public java.lang.String getFullNameEscaped()
@Deprecated public java.lang.String getName()
getShortName()
and getFullName()
public abstract void hashCodeShow(Indent indent)
public int localhash()
public static CDMNode unwrap(CDMNode node)
node
- possibly wrapped odepublic java.util.Map<java.lang.String,java.lang.Object> getAnnotations()
public java.lang.Object getAnnotation(java.lang.String key)
public java.lang.Object annotate(java.lang.String key, java.lang.Object value)