ucar.nc2.dataset
Class DatasetConstructor

java.lang.Object
  extended by ucar.nc2.dataset.DatasetConstructor

public class DatasetConstructor
extends Object

Helper methods for constructing NetcdfDatasets.

Since:
Jul 6, 2007
Author:
caron

Constructor Summary
DatasetConstructor()
           
 
Method Summary
static Group findGroup(NetcdfFile newFile, Group oldGroup)
          Find the Group in newFile that corresponds (by name) with oldGroup
static Dimension getBoundsDimension(NetcdfFile ncfile)
           
static void transferDataset(NetcdfFile src, NetcdfDataset target, ReplaceVariableCheck replaceCheck)
          Copy contents of "src" to "target".
static void transferGroupAttributes(Group src, Group target)
          Copy attributes from src to target, skip ones that already exist (by name)
static void transferVariableAttributes(Variable src, Variable target)
          Copy attributes from src to target, skip ones that already exist (by name)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatasetConstructor

public DatasetConstructor()
Method Detail

transferDataset

public static void transferDataset(NetcdfFile src,
                                   NetcdfDataset target,
                                   ReplaceVariableCheck replaceCheck)
Copy contents of "src" to "target". skip ones that already exist (by name). Dimensions and Variables are replaced with equivalent elements, but unlimited dimensions are turned into regular dimensions. Attribute doesnt have to be replaced because its immutable, so its copied by reference.

Parameters:
src - transfer from here. If src is a NetcdfDataset, transferred variables get reparented to target group.
target - transfer to this NetcdfDataset.
replaceCheck - if null, add if a Variable of the same name doesnt already exist, otherwise replace if replaceCheck.replace( Variable v) is true

transferVariableAttributes

public static void transferVariableAttributes(Variable src,
                                              Variable target)
Copy attributes from src to target, skip ones that already exist (by name)

Parameters:
src - copy from here
target - copy to here

transferGroupAttributes

public static void transferGroupAttributes(Group src,
                                           Group target)
Copy attributes from src to target, skip ones that already exist (by name)

Parameters:
src - copy from here
target - copy to here

findGroup

public static Group findGroup(NetcdfFile newFile,
                              Group oldGroup)
Find the Group in newFile that corresponds (by name) with oldGroup

Parameters:
newFile - look in this NetcdfFile
oldGroup - corresponding (by name) with oldGroup
Returns:
corresponding Group, or null if no match.

getBoundsDimension

public static Dimension getBoundsDimension(NetcdfFile ncfile)


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.