ucar.nc2.dt
Class TypedDatasetFactory

java.lang.Object
  extended by ucar.nc2.dt.TypedDatasetFactory

public class TypedDatasetFactory
extends java.lang.Object

Manager of factories for TypedDatasets. NOTE: use ucar.nc2.ft.FeatureDatasetFactoryManager instead, starting with 4.0

Author:
caron

Constructor Summary
TypedDatasetFactory()
           
 
Method Summary
static TypedDataset open(FeatureType datatype, NetcdfDataset ncd, CancelTask task, java.lang.StringBuilder errlog)
          Open a dataset as a TypedDataset.
static TypedDataset open(FeatureType datatype, java.lang.String location, CancelTask task, java.lang.StringBuilder errlog)
          Open a dataset as a TypedDataset.
static void registerFactory(FeatureType datatype, java.lang.Class c)
          Register a class that implements a TypedDatasetFactoryIF.
static void registerFactory(FeatureType datatype, java.lang.String className)
          Register a class that implements a TypedDatasetFactoryIF.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypedDatasetFactory

public TypedDatasetFactory()
Method Detail

registerFactory

public static void registerFactory(FeatureType datatype,
                                   java.lang.String className)
                            throws java.lang.ClassNotFoundException
Register a class that implements a TypedDatasetFactoryIF.

Parameters:
className - name of class that implements TypedDatasetFactoryIF.
datatype - scientific data type
Throws:
java.lang.ClassNotFoundException - if loading error

registerFactory

public static void registerFactory(FeatureType datatype,
                                   java.lang.Class c)
Register a class that implements a TypedDatasetFactoryIF.

Parameters:
datatype - scientific data type
c - class that implements TypedDatasetFactoryIF.

open

public static TypedDataset open(FeatureType datatype,
                                java.lang.String location,
                                CancelTask task,
                                java.lang.StringBuilder errlog)
                         throws java.io.IOException
Open a dataset as a TypedDataset.

Parameters:
datatype - open this kind of Typed Dataset; may be null, which means search all factories. If datatype is not null, only return correct TypedDataset (eg PointObsDataset for DataType.POINT).
location - URL or file location of the dataset
task - user may cancel
errlog - place errors here, may not be null
Returns:
a subclass of TypedDataset
Throws:
java.io.IOException - on io error

open

public static TypedDataset open(FeatureType datatype,
                                NetcdfDataset ncd,
                                CancelTask task,
                                java.lang.StringBuilder errlog)
                         throws java.io.IOException
Open a dataset as a TypedDataset.

Parameters:
datatype - open this kind of Typed Dataset; may be null, which means search all factories. If datatype is not null, only return correct TypedDataset (eg PointObsDataset for DataType.POINT).
ncd - the NetcdfDataset to wrap in a TypedDataset
task - user may cancel
errlog - place errors here, may not be null
Returns:
a subclass of TypedDataset, or null if cant find
Throws:
java.io.IOException - on io error