ucar.nc2.ncml
Class Aggregation.Dataset

java.lang.Object
  extended by ucar.nc2.ncml.Aggregation.Dataset
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
AggregationFmrcSingle.DatasetFmrcSingle, AggregationFmrcSingle.OpenDataset
Enclosing class:
Aggregation

public class Aggregation.Dataset
extends java.lang.Object
implements java.lang.Comparable

Encapsolates a NetcdfFile that is a component of the aggregation.


Field Summary
protected  java.lang.String cacheLocation
           
protected  java.util.Set<NetcdfDataset.Enhance> enhance
           
protected  java.lang.Object extraInfo
           
protected  java.lang.String id
           
protected  java.lang.String location
           
protected  FileFactory reader
           
 
Constructor Summary
protected Aggregation.Dataset(CrawlableDataset cd)
           
protected Aggregation.Dataset(java.lang.String location)
          For subclasses.
protected Aggregation.Dataset(java.lang.String cacheLocation, java.lang.String location, java.lang.String id, java.util.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(java.lang.Object o)
           
 boolean equals(java.lang.Object oo)
           
 java.lang.String getCacheLocation()
           
 java.lang.String getId()
           
 java.lang.String getLocation()
          Get the location of this Dataset
 int hashCode()
           
protected  Array read(Variable mainv, CancelTask cancelTask)
           
protected  Array read(Variable mainv, CancelTask cancelTask, java.util.List<Range> section)
          Read a section of the local Variable.
 void show(java.util.Formatter f)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

location

protected java.lang.String location

id

protected java.lang.String id

cacheLocation

protected java.lang.String cacheLocation

reader

protected FileFactory reader

enhance

protected java.util.Set<NetcdfDataset.Enhance> enhance

extraInfo

protected java.lang.Object extraInfo
Constructor Detail

Aggregation.Dataset

protected Aggregation.Dataset(java.lang.String location)
For subclasses.

Parameters:
location - location attribute on the netcdf element

Aggregation.Dataset

protected Aggregation.Dataset(CrawlableDataset cd)

Aggregation.Dataset

protected Aggregation.Dataset(java.lang.String cacheLocation,
                              java.lang.String location,
                              java.lang.String id,
                              java.util.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 java.lang.String getLocation()
Get the location of this Dataset

Returns:
the location of this Dataset

getCacheLocation

public java.lang.String getCacheLocation()

getId

public java.lang.String getId()

acquireFile

public NetcdfFile acquireFile(CancelTask cancelTask)
                       throws java.io.IOException
Throws:
java.io.IOException

close

protected void close(NetcdfFile ncfile)
              throws java.io.IOException
Throws:
java.io.IOException

cacheVariables

protected void cacheVariables(NetcdfFile ncfile)
                       throws java.io.IOException
Throws:
java.io.IOException

show

public void show(java.util.Formatter f)

read

protected Array read(Variable mainv,
                     CancelTask cancelTask)
              throws java.io.IOException
Throws:
java.io.IOException

read

protected Array read(Variable mainv,
                     CancelTask cancelTask,
                     java.util.List<Range> section)
              throws java.io.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:
java.io.IOException - on I/O error
InvalidRangeException - on section error

equals

public boolean equals(java.lang.Object oo)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

compareTo

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