ucar.nc2.dt.radial
Class RadialDatasetSweepAdapter

java.lang.Object
  extended by ucar.nc2.dt.TypedDatasetImpl
      extended by ucar.nc2.dt.radial.RadialDatasetSweepAdapter
All Implemented Interfaces:
RadialDatasetSweep, TypedDataset, FeatureDataset, FileCacheable
Direct Known Subclasses:
CFnetCDF2Dataset, Dorade2Dataset, LevelII2Dataset, Netcdf2Dataset, Nids2Dataset, UF2Dataset

public abstract class RadialDatasetSweepAdapter
extends TypedDatasetImpl
implements RadialDatasetSweep

Make a NetcdfDataset into a RadialDatasetSweep.

Author:
yuan

Nested Class Summary
 class RadialDatasetSweepAdapter.MyRadialVariableAdapter
           
 
Nested classes/interfaces inherited from interface ucar.nc2.dt.RadialDatasetSweep
RadialDatasetSweep.RadialVariable, RadialDatasetSweep.Sweep, RadialDatasetSweep.Type
 
Field Summary
protected  HashMap csHash
           
protected  DateUnit dateUnits
           
protected  FileCache fileCache
           
protected  EarthLocation origin
           
 
Fields inherited from class ucar.nc2.dt.TypedDatasetImpl
boundingBox, dataVariables, desc, endDate, location, ncfile, parseInfo, startDate, title
 
Fields inherited from interface ucar.nc2.dt.RadialDatasetSweep
LevelII, UF
 
Constructor Summary
RadialDatasetSweepAdapter()
           
RadialDatasetSweepAdapter(NetcdfDataset ds)
           
 
Method Summary
protected abstract  void addRadialVariable(NetcdfDataset ds, Variable var)
           
 void calcBounds()
          Caclulate date range and bounding box, even if the data has to be scanned.
 void close()
          Close all resources associated with this dataset.
 RadialDatasetSweep.Type getCommonType()
          If all the sweeps are the same type, return it here, else NONE
 DateRange getDateRange()
          Date range for the entire dataset.
 String getDetailInfo()
           
 void getDetailInfo(Formatter sf)
          Show debug / underlying implementation details
 EarthLocation getEarthLocation()
           
 FeatureType getFeatureType()
          Contains collections of this FeatureType.
 String getImplementationName()
          Show who is implementing
 DateUnit getTimeUnits()
          Get the units of Calendar time.
protected abstract  RadialDatasetSweep.RadialVariable makeRadialVariable(NetcdfDataset nds, VariableSimpleIF v, Variable v0)
           
protected  void setBoundingBox()
           
protected abstract  void setEarthLocation()
           
 void setFileCache(FileCache fileCache)
          If the FileCache is set, the FileCacheable object must store it and call FileCache.release() on FileCacheable.close():
protected abstract  void setTimeUnits()
           
 boolean sync()
          Sync() is called when the FileCacheable is found in the cache, before returning the object to the application.
 
Methods inherited from class ucar.nc2.dt.TypedDatasetImpl
findGlobalAttributeIgnoreCase, getBoundingBox, getDataVariable, getDataVariables, getDescription, getEndDate, getGlobalAttributes, getLocation, getLocationURI, getNetcdfFile, getStartDate, getTitle, removeDataVariable, setDescription, setEndDate, setLocationURI, setStartDate, setTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ucar.nc2.dt.RadialDatasetSweep
clearDatasetMemory, getCommonOrigin, getDataFormat, getDataVariables, getRadarID, getRadarName, isStationary, isVolume
 
Methods inherited from interface ucar.nc2.dt.TypedDataset
findGlobalAttributeIgnoreCase, getBoundingBox, getDataVariable, getDescription, getEndDate, getGlobalAttributes, getLocationURI, getNetcdfFile, getStartDate, getTitle
 
Methods inherited from interface ucar.nc2.ft.FeatureDataset
findGlobalAttributeIgnoreCase, getBoundingBox, getDataVariable, getDescription, getEndDate, getGlobalAttributes, getLocation, getNetcdfFile, getStartDate, getTitle
 

Field Detail

origin

protected EarthLocation origin

csHash

protected HashMap csHash

dateUnits

protected DateUnit dateUnits

fileCache

protected FileCache fileCache
Constructor Detail

RadialDatasetSweepAdapter

public RadialDatasetSweepAdapter()

RadialDatasetSweepAdapter

public RadialDatasetSweepAdapter(NetcdfDataset ds)
Method Detail

addRadialVariable

protected abstract void addRadialVariable(NetcdfDataset ds,
                                          Variable var)

makeRadialVariable

protected abstract RadialDatasetSweep.RadialVariable makeRadialVariable(NetcdfDataset nds,
                                                                        VariableSimpleIF v,
                                                                        Variable v0)

setTimeUnits

protected abstract void setTimeUnits()
                              throws Exception
Throws:
Exception

getDetailInfo

public String getDetailInfo()
Specified by:
getDetailInfo in interface TypedDataset
Overrides:
getDetailInfo in class TypedDatasetImpl
Returns:
debug / underlying implementation details

setEarthLocation

protected abstract void setEarthLocation()

getCommonType

public RadialDatasetSweep.Type getCommonType()
Description copied from interface: RadialDatasetSweep
If all the sweeps are the same type, return it here, else NONE

Specified by:
getCommonType in interface RadialDatasetSweep
Returns:
type of sweep, or NONE

getTimeUnits

public DateUnit getTimeUnits()
Description copied from interface: RadialDatasetSweep
Get the units of Calendar time. To get a Date, from a time value, call DateUnit.getStandardDate(double value). To get units as a String, call DateUnit.getUnitsString().

Specified by:
getTimeUnits in interface RadialDatasetSweep
Returns:
units of Calendar time

getEarthLocation

public EarthLocation getEarthLocation()

setBoundingBox

protected void setBoundingBox()
Specified by:
setBoundingBox in class TypedDatasetImpl

calcBounds

public void calcBounds()
                throws IOException
Description copied from interface: FeatureDataset
Caclulate date range and bounding box, even if the data has to be scanned. This ensures that getDateRange() and getBoundingBox() return non-null. If the collection already knows its date range and bounding box, then this has no effect.

Specified by:
calcBounds in interface FeatureDataset
Throws:
IOException - or read error.

getFeatureType

public FeatureType getFeatureType()
Description copied from interface: FeatureDataset
Contains collections of this FeatureType.

Specified by:
getFeatureType in interface FeatureDataset
Returns:
FeatureType of data

getDateRange

public DateRange getDateRange()
Description copied from interface: FeatureDataset
Date range for the entire dataset.

Specified by:
getDateRange in interface FeatureDataset
Returns:
the date range for the entire dataset, or null if unknown

getDetailInfo

public void getDetailInfo(Formatter sf)
Description copied from interface: FeatureDataset
Show debug / underlying implementation details

Specified by:
getDetailInfo in interface FeatureDataset
Parameters:
sf - append info here

getImplementationName

public String getImplementationName()
Description copied from interface: FeatureDataset
Show who is implementing

Specified by:
getImplementationName in interface FeatureDataset
Returns:
name of implementor

close

public void close()
           throws IOException
Description copied from interface: TypedDataset
Close all resources associated with this dataset.

Specified by:
close in interface TypedDataset
Specified by:
close in interface FeatureDataset
Specified by:
close in interface FileCacheable
Overrides:
close in class TypedDatasetImpl
Throws:
IOException

sync

public boolean sync()
             throws IOException
Description copied from interface: FileCacheable
Sync() is called when the FileCacheable is found in the cache, before returning the object to the application. FileCacheable has an opportunity to freshen itself. FileCacheable mag ignore this call.

Specified by:
sync in interface FileCacheable
Returns:
true if FileCacheable was changed
Throws:
IOException - on i/o error.

setFileCache

public void setFileCache(FileCache fileCache)
Description copied from interface: FileCacheable
If the FileCache is set, the FileCacheable object must store it and call FileCache.release() on FileCacheable.close():
  public synchronized void close() throws java.io.IOException {
    if (isClosed) return;
    if (cache != null) {
      cache.release(this);
    } else {
      reallyClose();
    }
    isClosed = true;
   

Specified by:
setFileCache in interface FileCacheable
Parameters:
fileCache - must store this, use it on close as above.


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