Package ucar.nc2.ncml
Class Aggregation.Dataset
- java.lang.Object
-
- ucar.nc2.ncml.Aggregation.Dataset
-
- All Implemented Interfaces:
Comparable<Aggregation.Dataset>
- Enclosing class:
- Aggregation
public class Aggregation.Dataset extends Object implements Comparable<Aggregation.Dataset>
Encapsolates a NetcdfFile that is a component of the aggregation.
-
-
Field Summary
Fields Modifier and Type Field Description protected StringcacheLocationprotected DatasetUrldurlprotected Set<NetcdfDataset.Enhance>enhanceprotected Stringidprotected FileFactoryreader
-
Constructor Summary
Constructors Modifier Constructor Description protectedDataset(String cacheLocation, String location, String id, EnumSet<NetcdfDataset.Enhance> enhance, FileFactory reader)Dataset constructor.protectedDataset(MFile mfile)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NetcdfFileacquireFile(CancelTask cancelTask)protected voidcacheVariables(NetcdfFile ncfile)protected voidclose(NetcdfFile ncfile)intcompareTo(Aggregation.Dataset o)booleanequals(Object oo)protected VariablefindVariable(NetcdfFile ncfile, Variable mainV)StringgetCacheLocation()StringgetId()StringgetLocation()Get the location of this DatasetMFilegetMFile()inthashCode()protected Arrayread(Variable mainv, CancelTask cancelTask)protected Arrayread(Variable mainv, CancelTask cancelTask, List<Range> section)Read a section of the local Variable.voidshow(Formatter f)
-
-
-
Field Detail
-
id
protected String id
-
cacheLocation
protected String cacheLocation
-
reader
protected FileFactory reader
-
enhance
protected Set<NetcdfDataset.Enhance> enhance
-
durl
protected DatasetUrl durl
-
-
Constructor Detail
-
Dataset
protected Dataset(MFile mfile)
-
Dataset
protected Dataset(String cacheLocation, String location, String id, EnumSet<NetcdfDataset.Enhance> enhance, FileFactory reader)
Dataset constructor. With this constructor, the actual opening of the dataset is deferred, and done by the reader. Used with explicit netcdf elements, and scanned files.- Parameters:
cacheLocation- a unique name to use for cachinglocation- attribute "location" on the netcdf elementid- attribute "id" on the netcdf elementenhance- open dataset in enhance mode, may be null NOT USEDreader- factory for reading this netcdf dataset; if null, use NetcdfDataset.open( location)
-
-
Method Detail
-
getLocation
public String getLocation()
Get the location of this Dataset- Returns:
- the location of this Dataset
-
getMFile
public MFile getMFile()
- Returns:
- MFile or null
-
getCacheLocation
public String getCacheLocation()
-
getId
public String getId()
-
acquireFile
public NetcdfFile acquireFile(CancelTask cancelTask) throws IOException
- Throws:
IOException
-
close
protected void close(NetcdfFile ncfile) throws IOException
- Throws:
IOException
-
cacheVariables
protected void cacheVariables(NetcdfFile ncfile) throws IOException
- Throws:
IOException
-
show
public void show(Formatter f)
-
read
protected Array read(Variable mainv, CancelTask cancelTask) throws IOException
- Throws:
IOException
-
read
protected Array read(Variable mainv, CancelTask cancelTask, List<Range> section) throws IOException, InvalidRangeException
Read a section of the local Variable.- Parameters:
mainv- aggregated VariablecancelTask- let user cancelsection- relative to the local Variable- Returns:
- the complete Array for mainv
- Throws:
IOException- on I/O errorInvalidRangeException- on section error
-
findVariable
protected Variable findVariable(NetcdfFile ncfile, Variable mainV)
-
compareTo
public int compareTo(Aggregation.Dataset o)
- Specified by:
compareToin interfaceComparable<Aggregation.Dataset>
-
-