Package dap4.cdm
Class NodeMap<CDM_T extends ucar.nc2.CDMNode,DAP_T extends dap4.core.dmr.DapNode>
- java.lang.Object
-
- dap4.cdm.NodeMap<CDM_T,DAP_T>
-
public class NodeMap<CDM_T extends ucar.nc2.CDMNode,DAP_T extends dap4.core.dmr.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 booleancontainsKey(CDM_T node)booleancontainsKey(DAP_T node)DAP_Tget(CDM_T cdm)CDM_Tget(DAP_T dap)Map<DAP_T,CDM_T>getCDMMap()voidput(CDM_T cdm, DAP_T dap)Given a CDM_T <-> DAP_T pair, insert into the mapsvoidremove(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-
-
-