Package ucar.nc2.grib.collection
Class GribCollectionImmutable
- java.lang.Object
-
- ucar.nc2.grib.collection.GribCollectionImmutable
-
- All Implemented Interfaces:
Closeable,AutoCloseable,ucar.nc2.util.cache.FileCacheable
- Direct Known Subclasses:
Grib1Collection,Grib2Collection,PartitionCollectionImmutable
@Immutable public abstract class GribCollectionImmutable extends Object implements Closeable, ucar.nc2.util.cache.FileCacheable
An Immutable GribCollection, corresponds to one index (ncx) file. The index file has already been read; it is opened and the closed when a variable is first accessed to read in the record array (sa).Could use the Proto equivalents, and eliminate GribCollectionMutable ?
- Since:
- 11/10/2014
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classGribCollectionImmutable.DatasetclassGribCollectionImmutable.GroupGCstatic classGribCollectionImmutable.Recordstatic classGribCollectionImmutable.TypeclassGribCollectionImmutable.VariableIndex
-
Field Summary
Fields Modifier and Type Field Description protected thredds.featurecollection.FeatureCollectionConfigconfigstatic intcountGCprotected GribTablescustprotected List<GribCollectionImmutable.Dataset>datasetsprotected ucar.nc2.time.CalendarDateRangedateRangeprotected Filedirectoryprotected Map<Integer,thredds.inventory.MFile>fileMapprotected StringindexFilenameprotected ucar.nc2.grib.collection.GribCollectionImmutable.InfoinfobooleanisGrib1protected CoordinateRuntimemasterRuntimeprotected Stringname
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description abstract voidaddGlobalAttributes(ucar.nc2.AttributeContainer result)abstract voidaddVariableAttributes(ucar.nc2.AttributeContainer v, GribCollectionImmutable.VariableIndex vindex)voidclose()thredds.inventory.MFilefindMFileByName(String filename)intgetBackProcessId()intgetCenter()GribCollectionImmutable.DatasetgetDataset(int idx)GribCollectionImmutable.DatasetgetDatasetCanonical()List<GribCollectionImmutable.Dataset>getDatasets()FilegetDirectory()thredds.inventory.MFilegetFile(int fileno)StringgetFilename(int fileno)Collection<thredds.inventory.MFile>getFiles()intgetGenProcessId()intgetGenProcessType()ucar.nc2.AttributeContainergetGlobalAttributes()abstract ucar.nc2.ft2.coverage.CoverageCollectiongetGridCoverage(GribCollectionImmutable.Dataset ds, GribCollectionImmutable.GroupGC group, String filename, thredds.featurecollection.FeatureCollectionConfig gribConfig, Formatter errlog, org.slf4j.Logger logger)abstract ucar.nc2.dt.grid.GridDatasetgetGridDataset(GribCollectionImmutable.Dataset ds, GribCollectionImmutable.GroupGC group, String filename, thredds.featurecollection.FeatureCollectionConfig gribConfig, Formatter errlog, org.slf4j.Logger logger)longgetIndexFileSize()longgetLastModified()intgetLocal()StringgetLocation()intgetMaster()ucar.nc2.time.CalendarDategetMasterFirstDate()CoordinateRuntimegetMasterRuntime()StringgetName()abstract ucar.nc2.dataset.NetcdfDatasetgetNetcdfDataset(GribCollectionImmutable.Dataset ds, GribCollectionImmutable.GroupGC group, String filename, thredds.featurecollection.FeatureCollectionConfig gribConfig, Formatter errlog, org.slf4j.Logger logger)intgetSubcenter()intgetVersion()protected abstract StringmakeVariableId(GribCollectionImmutable.VariableIndex v)protected GribCollectionImmutable.VariableIndexmakeVariableIndex(GribCollectionImmutable.GroupGC group, GribCollectionMutable.VariableIndex mutableVar)voidreacquire()Deprecated.do not use.voidrelease()Deprecated.do not use.voidsetFileCache(ucar.nc2.util.cache.FileCacheIF fileCache)Deprecated.do not usevoidshowIndex(Formatter f)voidshowStatus(Formatter f)voidshowStatusSummary(Formatter f, String type)StringtoString()
-
-
-
Field Detail
-
countGC
public static int countGC
-
name
protected final String name
-
directory
protected final File directory
-
config
protected final thredds.featurecollection.FeatureCollectionConfig config
-
isGrib1
public final boolean isGrib1
-
info
protected final ucar.nc2.grib.collection.GribCollectionImmutable.Info info
-
datasets
protected final List<GribCollectionImmutable.Dataset> datasets
-
masterRuntime
protected final CoordinateRuntime masterRuntime
-
dateRange
protected final ucar.nc2.time.CalendarDateRange dateRange
-
cust
protected final GribTables cust
-
indexFilename
protected final String indexFilename
-
-
Method Detail
-
makeVariableIndex
protected GribCollectionImmutable.VariableIndex makeVariableIndex(GribCollectionImmutable.GroupGC group, GribCollectionMutable.VariableIndex mutableVar)
-
getDatasets
public List<GribCollectionImmutable.Dataset> getDatasets()
-
getDataset
public GribCollectionImmutable.Dataset getDataset(int idx)
-
getDatasetCanonical
public GribCollectionImmutable.Dataset getDatasetCanonical()
-
getName
public String getName()
-
getDirectory
public File getDirectory()
-
getMasterRuntime
public CoordinateRuntime getMasterRuntime()
-
getMasterFirstDate
public ucar.nc2.time.CalendarDate getMasterFirstDate()
-
getVersion
public int getVersion()
-
getCenter
public int getCenter()
-
getSubcenter
public int getSubcenter()
-
getMaster
public int getMaster()
-
getLocal
public int getLocal()
-
getGenProcessType
public int getGenProcessType()
-
getGenProcessId
public int getGenProcessId()
-
getBackProcessId
public int getBackProcessId()
-
getGlobalAttributes
public ucar.nc2.AttributeContainer getGlobalAttributes()
-
addGlobalAttributes
public abstract void addGlobalAttributes(ucar.nc2.AttributeContainer result)
-
addVariableAttributes
public abstract void addVariableAttributes(ucar.nc2.AttributeContainer v, GribCollectionImmutable.VariableIndex vindex)
-
makeVariableId
protected abstract String makeVariableId(GribCollectionImmutable.VariableIndex v)
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceucar.nc2.util.cache.FileCacheable- Throws:
IOException
-
release
@Deprecated public void release()
Deprecated.do not use.release any resources like file handles.- Specified by:
releasein interfaceucar.nc2.util.cache.FileCacheable
-
reacquire
@Deprecated public void reacquire()
Deprecated.do not use.reacquire any resources like file handles.- Specified by:
reacquirein interfaceucar.nc2.util.cache.FileCacheable
-
getLocation
public String getLocation()
- Specified by:
getLocationin interfaceucar.nc2.util.cache.FileCacheable
-
getLastModified
public long getLastModified()
- Specified by:
getLastModifiedin interfaceucar.nc2.util.cache.FileCacheable
-
setFileCache
@Deprecated public void setFileCache(ucar.nc2.util.cache.FileCacheIF fileCache)
Deprecated.do not use- Specified by:
setFileCachein interfaceucar.nc2.util.cache.FileCacheable
-
showStatus
public void showStatus(Formatter f)
-
showIndex
public void showIndex(Formatter f)
-
getIndexFileSize
public long getIndexFileSize()
-
getFile
public thredds.inventory.MFile getFile(int fileno)
-
getFilename
public String getFilename(int fileno)
-
getFiles
public Collection<thredds.inventory.MFile> getFiles()
-
findMFileByName
@Nullable public thredds.inventory.MFile findMFileByName(String filename)
-
getNetcdfDataset
@Nullable public abstract ucar.nc2.dataset.NetcdfDataset getNetcdfDataset(GribCollectionImmutable.Dataset ds, GribCollectionImmutable.GroupGC group, String filename, thredds.featurecollection.FeatureCollectionConfig gribConfig, Formatter errlog, org.slf4j.Logger logger) throws IOException
- Throws:
IOException
-
getGridDataset
@Nullable public abstract ucar.nc2.dt.grid.GridDataset getGridDataset(GribCollectionImmutable.Dataset ds, GribCollectionImmutable.GroupGC group, String filename, thredds.featurecollection.FeatureCollectionConfig gribConfig, Formatter errlog, org.slf4j.Logger logger) throws IOException
- Throws:
IOException
-
getGridCoverage
@Nullable public abstract ucar.nc2.ft2.coverage.CoverageCollection getGridCoverage(GribCollectionImmutable.Dataset ds, GribCollectionImmutable.GroupGC group, String filename, thredds.featurecollection.FeatureCollectionConfig gribConfig, Formatter errlog, org.slf4j.Logger logger) throws IOException
- Throws:
IOException
-
-