ucar.nc2.ncml
Class Aggregation.Dataset

java.lang.Object
  extended by ucar.nc2.ncml.Aggregation.Dataset
All Implemented Interfaces:
Comparable
Enclosing class:
Aggregation

public class Aggregation.Dataset
extends Object
implements Comparable

Encapsolates a NetcdfFile that is a component of the aggregation.


Field Summary
protected  String cacheLocation
           
protected  Set<NetcdfDataset.Enhance> enhance
           
protected  Object extraInfo
           
protected  String id
           
protected  String location
           
protected  FileFactory reader
           
 
Constructor Summary
protected Aggregation.Dataset(MFile mfile)
           
protected Aggregation.Dataset(String location)
          For subclasses.
protected Aggregation.Dataset(String cacheLocation, String location, String id, EnumSet<NetcdfDataset.Enhance> enhance, FileFactory reader)
          Dataset constructor.
 
Method Summary
 NetcdfFile acquireFile(CancelTask cancelTask)
           
protected  void cacheVariables(NetcdfFile ncfile)
           
protected  void close(NetcdfFile ncfile)
           
 int compareTo(Object o)
           
 boolean equals(Object oo)
           
protected  Variable findVariable(NetcdfFile ncfile, Variable mainV)
           
 String getCacheLocation()
           
 String getId()
           
 String getLocation()
          Get the location of this Dataset
 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)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

location

protected final String location

id

protected String id

cacheLocation

protected String cacheLocation

reader

protected FileFactory reader

enhance

protected Set<NetcdfDataset.Enhance> enhance

extraInfo

protected Object extraInfo
Constructor Detail

Aggregation.Dataset

protected Aggregation.Dataset(String location)
For subclasses.

Parameters:
location - location attribute on the netcdf element

Aggregation.Dataset

protected Aggregation.Dataset(MFile mfile)

Aggregation.Dataset

protected Aggregation.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 caching
location - attribute "location" on the netcdf element
id - attribute "id" on the netcdf element
enhance - open dataset in enhance mode, may be null NOT USED
reader - 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

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 Variable
cancelTask - let user cancel
section - reletive to the local Variable
Returns:
the complete Array for mainv
Throws:
IOException - on I/O error
InvalidRangeException - on section error

findVariable

protected Variable findVariable(NetcdfFile ncfile,
                                Variable mainV)

equals

public boolean equals(Object oo)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable


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