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 String
cacheLocation
protected DatasetUrl
durl
protected Set<NetcdfDataset.Enhance>
enhance
protected String
id
protected FileFactory
reader
-
Constructor Summary
Constructors Modifier Constructor Description protected
Dataset(String cacheLocation, String location, String id, EnumSet<NetcdfDataset.Enhance> enhance, FileFactory reader)
Dataset constructor.protected
Dataset(MFile mfile)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NetcdfFile
acquireFile(CancelTask cancelTask)
protected void
cacheVariables(NetcdfFile ncfile)
protected void
close(NetcdfFile ncfile)
int
compareTo(Aggregation.Dataset o)
boolean
equals(Object oo)
protected Variable
findVariable(NetcdfFile ncfile, Variable mainV)
String
getCacheLocation()
String
getId()
String
getLocation()
Get the location of this DatasetMFile
getMFile()
int
hashCode()
protected Array
read(Variable mainv, CancelTask cancelTask)
protected Array
read(Variable mainv, CancelTask cancelTask, List<Range> section)
Read a section of the local Variable.void
show(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:
compareTo
in interfaceComparable<Aggregation.Dataset>
-
-