public abstract class CDMNode extends 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 Map<Object,Object> |
annotations |
protected String |
dodsname |
protected Group |
group |
protected boolean |
immutable |
protected Structure |
parentstruct |
protected String |
shortName |
protected CDMSort |
sort |
Modifier | Constructor and Description |
---|---|
protected |
CDMNode() |
|
CDMNode(String name) |
Modifier and Type | Method and Description |
---|---|
Object |
annotate(Object id,
Object value) |
Object |
annotation(Object id) |
String |
getDODSName()
Get the dodsname
|
String |
getFullName()
Get the Full name of this object.
|
String |
getFullNameEscaped()
Alias for getFullName
|
Group |
getGroup()
Alias for getParentGroup
|
boolean |
getImmutable()
Get immutable flag
As a rule, subclasses will access directly
|
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
|
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(String name)
Store the original dods name
|
CDMNode |
setImmutable()
Set the immutable flag to true.
|
void |
setParentGroup(Group parent)
Set the parent Group
|
void |
setParentStructure(Structure parent)
Set the parent Structure
|
void |
setShortName(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 String shortName
protected String dodsname
protected CDMNode()
public CDMNode(String name)
public CDMSort getSort()
public void setSort(CDMSort sort)
public String getShortName()
public void setShortName(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 CDMNode setImmutable()
public String getDODSName()
public void setDODSName(String name)
name
- The original name from the DDS/DASpublic String getFullName()
public String getFullNameEscaped()
@Deprecated public String getName()
getShortName()
and getFullName()
public abstract void hashCodeShow(Indent indent)
public int localhash()
public static CDMNode unwrap(CDMNode node)
node
- possibly wrapped ode