Package dap4.dap4lib.cdm
Class NodeMap<CDM_T extends CDMNode,DAP_T extends DapNode>
- java.lang.Object
-
- dap4.dap4lib.cdm.NodeMap<CDM_T,DAP_T>
-
public class NodeMap<CDM_T extends CDMNode,DAP_T extends DapNode> extends Object
Provide a bi-directional 1-1 map between DapNode instances and CDMNode instances.There is a complication. Currently, the hashCode() in ucar.nc2.Variable (and other classes) is unstable when objects are being incrementally constructed. So until and unless that is changed, it is necessary to provide a way to map CDMNode <-> DapNode that is independent of e.g Variable.hashCode(); We do this by overriding hashCode() to use Object.hashCode() explicitly.
-
-
Constructor Summary
Constructors Constructor Description NodeMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsKey(CDM_T node)
boolean
containsKey(DAP_T node)
DAP_T
get(CDM_T cdm)
CDM_T
get(DAP_T dap)
Map<DAP_T,CDM_T>
getCDMMap()
void
put(CDM_T cdm, DAP_T dap)
Given a CDM_T <-> DAP_T pair, insert into the mapsvoid
remove(CDM_T cdm, DAP_T dap)
Given a DAP_T <-> CDM_T pair, remove from the maps
-
-
-
Method Detail
-
containsKey
public boolean containsKey(CDM_T node)
-
containsKey
public boolean containsKey(DAP_T node)
-
put
public void put(CDM_T cdm, DAP_T dap)
Given a CDM_T <-> DAP_T pair, insert into the maps- Parameters:
cdm
-dap
-
-
remove
public void remove(CDM_T cdm, DAP_T dap)
Given a DAP_T <-> CDM_T pair, remove from the maps- Parameters:
cdm
-dap
-
-
-