ucar.nc2.ncml
Class AggregationOuterDimension

java.lang.Object
  extended by ucar.nc2.ncml.Aggregation
      extended by ucar.nc2.ncml.AggregationOuterDimension
All Implemented Interfaces:
ProxyReader
Direct Known Subclasses:
AggregationExisting, AggregationFmrc, AggregationNew

public abstract class AggregationOuterDimension
extends Aggregation

Superclass for Aggregations on the outer dimension: joinNew, joinExisting, Fmrc, FmrcSingle

Since:
Aug 10, 2007
Author:
caron

Nested Class Summary
 
Nested classes/interfaces inherited from class ucar.nc2.ncml.Aggregation
Aggregation.Dataset, Aggregation.DatasetProxyReader, Aggregation.Type, Aggregation.TypicalDataset
 
Field Summary
protected  java.util.List<java.lang.String> aggVarNames
           
protected  java.util.List<VariableDS> aggVars
           
protected  java.util.List<ucar.nc2.ncml.AggregationOuterDimension.CacheVar> cacheList
           
protected static boolean debugCache
           
protected static boolean debugInvocation
           
static int invocation
           
protected  boolean timeUnitsChange
           
 
Fields inherited from class ucar.nc2.ncml.Aggregation
cacheDirty, datasetManager, datasets, dateFormatMark, dateFormatter, debug, debugDateParse, debugOpenFile, debugProxy, debugRead, debugSyncDetail, dimName, diskCache2, executor, explicitDatasets, isDate, logger, ncDataset, spiObject, type, typicalDatasetMode
 
Constructor Summary
protected AggregationOuterDimension(NetcdfDataset ncd, java.lang.String dimName, Aggregation.Type type, java.lang.String recheckS)
          Create an Aggregation for the given NetcdfDataset.
 
Method Summary
 void addVariable(java.lang.String varName)
          Add a name for a variableAgg element
protected  void buildCoords(CancelTask cancelTask)
           
 void detail(java.util.Formatter f)
           
 void getDetailInfo(java.util.Formatter f)
           
protected  int getTotalCoords()
           
static void main(java.lang.String[] args)
           
protected  Aggregation.Dataset makeDataset(CrawlableDataset dset)
           
protected  Aggregation.Dataset makeDataset(java.lang.String cacheName, java.lang.String location, java.lang.String id, java.lang.String ncoordS, java.lang.String coordValueS, java.lang.String sectionSpec, java.util.EnumSet<NetcdfDataset.Enhance> enhance, FileFactory reader)
          Dataset factory, so subclasses can override
protected  void promoteGlobalAttributes(ucar.nc2.ncml.AggregationOuterDimension.DatasetOuterDimension typicalDataset)
           
 Array read(Variable mainv, CancelTask cancelTask)
          Read an aggregation variable: A variable whose data spans multiple files.
 Array read(Variable mainv, Section section, CancelTask cancelTask)
          Read a section of an aggregation variable.
protected  void rebuildDataset()
          Call this when rescan has found changed datasets
 
Methods inherited from class ucar.nc2.ncml.Aggregation
addDataset, addDatasetScan, addExplicitDataset, buildNetcdfDataset, close, closeDatasets, findVariable, finish, getDatasets, getDimensionName, getFileTypeDescription, getFileTypeId, getLocation, getType, getTypicalDataset, makeDatasets, persistRead, persistWrite, setDatasetAcquireProxy, setExecutor, setModifications, setPersistenceCache, setTypicalDatasetMode, sync, syncExtend
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debugCache

protected static boolean debugCache

debugInvocation

protected static boolean debugInvocation

invocation

public static int invocation

aggVarNames

protected java.util.List<java.lang.String> aggVarNames

aggVars

protected java.util.List<VariableDS> aggVars

cacheList

protected java.util.List<ucar.nc2.ncml.AggregationOuterDimension.CacheVar> cacheList

timeUnitsChange

protected boolean timeUnitsChange
Constructor Detail

AggregationOuterDimension

protected AggregationOuterDimension(NetcdfDataset ncd,
                                    java.lang.String dimName,
                                    Aggregation.Type type,
                                    java.lang.String recheckS)
Create an Aggregation for the given NetcdfDataset. The following addXXXX methods are called, then finish(), before the object is ready for use.

Parameters:
ncd - Aggregation belongs to this NetcdfDataset
dimName - the aggregation dimension name
type - the Aggregation.Type
recheckS - how often to check if files have changes
Method Detail

addVariable

public void addVariable(java.lang.String varName)
Add a name for a variableAgg element

Parameters:
varName - name of agg variable

getDetailInfo

public void getDetailInfo(java.util.Formatter f)
Overrides:
getDetailInfo in class Aggregation

buildCoords

protected void buildCoords(CancelTask cancelTask)
                    throws java.io.IOException
Throws:
java.io.IOException

getTotalCoords

protected int getTotalCoords()

promoteGlobalAttributes

protected void promoteGlobalAttributes(ucar.nc2.ncml.AggregationOuterDimension.DatasetOuterDimension typicalDataset)
                                throws java.io.IOException
Throws:
java.io.IOException

rebuildDataset

protected void rebuildDataset()
                       throws java.io.IOException
Description copied from class: Aggregation
Call this when rescan has found changed datasets

Specified by:
rebuildDataset in class Aggregation
Throws:
java.io.IOException - on read error

read

public Array read(Variable mainv,
                  CancelTask cancelTask)
           throws java.io.IOException
Read an aggregation variable: A variable whose data spans multiple files.

Specified by:
read in interface ProxyReader
Specified by:
read in class Aggregation
Parameters:
mainv - the aggregation variable
cancelTask - allow the user to cancel
Returns:
the data array
Throws:
java.io.IOException

read

public Array read(Variable mainv,
                  Section section,
                  CancelTask cancelTask)
           throws java.io.IOException,
                  InvalidRangeException
Read a section of an aggregation variable.

Specified by:
read in interface ProxyReader
Specified by:
read in class Aggregation
Parameters:
mainv - the aggregation variable
cancelTask - allow the user to cancel
section - read just this section of the data, array of Range
Returns:
the data array section
Throws:
java.io.IOException
InvalidRangeException - if section has incorrect rank or shape.

makeDataset

protected Aggregation.Dataset makeDataset(java.lang.String cacheName,
                                          java.lang.String location,
                                          java.lang.String id,
                                          java.lang.String ncoordS,
                                          java.lang.String coordValueS,
                                          java.lang.String sectionSpec,
                                          java.util.EnumSet<NetcdfDataset.Enhance> enhance,
                                          FileFactory reader)
Description copied from class: Aggregation
Dataset factory, so subclasses can override

Overrides:
makeDataset in class Aggregation
Parameters:
cacheName - a unique name to use for caching
location - attribute "location" on the netcdf element
id - attribute "id" on the netcdf element
ncoordS - attribute "ncoords" on the netcdf element
coordValueS - attribute "coordValue" on the netcdf element
sectionSpec - attribute "sectionSpec" on the netcdf element
enhance - open dataset in enhance mode NOT USED
reader - factory for reading this netcdf dataset
Returns:
a Aggregation.Dataset

makeDataset

protected Aggregation.Dataset makeDataset(CrawlableDataset dset)
Overrides:
makeDataset in class Aggregation

detail

public void detail(java.util.Formatter f)
Overrides:
detail in class Aggregation

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Throws:
java.io.IOException