visad.data.netcdf.in
Class NetcdfAdapter
- java.lang.Object
-
- visad.data.netcdf.in.NetcdfAdapter
-
public class NetcdfAdapter extends java.lang.ObjectA class for importing a netCDF dataset.
This implementation uses a
Strategyfor importing netCDF datasets. The initial strategy is determined from the Java (not JavaBean) property visad.data.netcdf.in.Strategy. If that property is set, then its values is used as the name of the initialStrategyclass to use. If that property is not set, then the initial strategy isStrategy.DEFAULT. See, however,setDefaultStrategy(Strategy).
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.StringIMPORT_STRATEGY_PROPERTYThe name of the import-strategy Java property.
-
Constructor Summary
Constructors Constructor and Description NetcdfAdapter(ucar.netcdf.Netcdf netcdf, QuantityDB quantityDB)Constructs from a netCDF dataset.NetcdfAdapter(ucar.netcdf.Netcdf netcdf, QuantityDB quantityDB, boolean charToText)Constructs from a netCDF dataset.NetcdfAdapter(View view)Constructs from a view of a netCDF dataset.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description DataImplgetData()Gets the VisAD data object corresponding to the netCDF dataset.DataImplgetData(Strategy strategy)Gets the VisAD data object corresponding to the netCDF dataset using a given strategy.static StrategygetDefaultStrategy()Returns the default strategy used to import a netCDF dataset.DataImplgetProxy()Returns a proxy for the VisAD data object corresponding to the netCDF dataset.static voidmain(java.lang.String[] args)Tests this class.static StrategysetDefaultStrategy(Strategy strategy)Sets the default strategy used to import a netCDF dataset.
-
-
-
Field Detail
-
IMPORT_STRATEGY_PROPERTY
public static final java.lang.String IMPORT_STRATEGY_PROPERTY
The name of the import-strategy Java property. (NOTE: A Java property is not a JavaBean property.)- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NetcdfAdapter
public NetcdfAdapter(ucar.netcdf.Netcdf netcdf, QuantityDB quantityDB) throws VisADException, java.rmi.RemoteException, java.io.IOException, BadFormExceptionConstructs from a netCDF dataset.- Parameters:
netcdf- The netCDF dataset to be adapted.quantityDB- A quantity database to be used to map netCDF variables to VisADQuantitys.- Throws:
VisADException- Problem in core VisAD. Probably some VisAD object couldn't be created.java.rmi.RemoteException- Remote data access failure.java.io.IOException- Data access I/O failure.BadFormException- Non-conforming netCDF dataset.
-
NetcdfAdapter
public NetcdfAdapter(ucar.netcdf.Netcdf netcdf, QuantityDB quantityDB, boolean charToText) throws VisADException, java.rmi.RemoteException, java.io.IOException, BadFormExceptionConstructs from a netCDF dataset.- Parameters:
netcdf- The netCDF dataset to be adapted.quantityDB- A quantity database to be used to map netCDF variables to VisADQuantitys.charToText- Specifies whether the NetcdfAdapter should map char variables to VisAD Text objects- Throws:
VisADException- Problem in core VisAD. Probably some VisAD object couldn't be created.java.rmi.RemoteException- Remote data access failure.java.io.IOException- Data access I/O failure.BadFormException- Non-conforming netCDF dataset.
-
NetcdfAdapter
public NetcdfAdapter(View view)
Constructs from a view of a netCDF dataset.- Parameters:
view- The view of the netCDF dataset to be adapted.
-
-
Method Detail
-
setDefaultStrategy
public static Strategy setDefaultStrategy(Strategy strategy)
Sets the default strategy used to import a netCDF dataset. Subsequent use of thegetData()method will use the given strategy.- Parameters:
strategy- The default strategy to use.- Returns:
- The previous strategy.
- Throws:
java.lang.NullPointerException- if the strategy isnull.
-
getDefaultStrategy
public static Strategy getDefaultStrategy()
Returns the default strategy used to import a netCDF dataset.- Returns:
- The default strategy.
-
getData
public DataImpl getData() throws java.io.IOException, VisADException, java.rmi.RemoteException, BadFormException, java.lang.OutOfMemoryError
Gets the VisAD data object corresponding to the netCDF dataset. This is a potentially expensive method in either time or space.
This implementation invokes method
getData(Strategy)with the defaultStrategy.- Returns:
- The top-level, VisAD data object in the netCDF dataset.
- Throws:
VisADException- Problem in core VisAD. Probably some VisAD object couldn't be created.java.io.IOException- Data access I/O failure.BadFormException- netCDF dataset doesn't conform to conventions implicit in the View that was passed to the constructor.java.lang.OutOfMemoryError- Couldn't read netCDF dataset into memory.java.rmi.RemoteException- if a Java RMI failure occurs.- See Also:
getData(Strategy)
-
getData
public DataImpl getData(Strategy strategy) throws java.io.IOException, VisADException, java.rmi.RemoteException, BadFormException, java.lang.OutOfMemoryError
Gets the VisAD data object corresponding to the netCDF dataset using a given strategy. This is a potentially expensive method in either time or space.- Parameters:
strategy- The strategy to use for importing the data.- Returns:
- The top-level, VisAD data object in the netCDF dataset.
- Throws:
VisADException- Problem in core VisAD. Probably some VisAD object couldn't be created.java.io.IOException- Data access I/O failure.BadFormException- netCDF dataset doesn't conform to conventions implicit in the View that was passed to the constructor.java.lang.OutOfMemoryError- Couldn't read netCDF dataset into memory.java.rmi.RemoteException- if a Java RMI failure occurs.
-
getProxy
public DataImpl getProxy() throws java.io.IOException, VisADException, java.rmi.RemoteException, BadFormException, java.lang.OutOfMemoryError
Returns a proxy for the VisAD data object corresponding to the netCDF dataset. Because of the way import strategies are used, this just invokes the getData() method.- Returns:
- A proxy for the top-level, VisAD data object in the netCDF dataset.
- Throws:
VisADException- Problem in core VisAD. Probably some VisAD object couldn't be created.java.io.IOException- Data access I/O failure.BadFormException- netCDF dataset doesn't conform to conventions implicit in constructing View.java.lang.OutOfMemoryError- Couldn't read netCDF dataset into memory.java.rmi.RemoteException- if a Java RMI failure occurs.- See Also:
Strategy.getData(visad.data.netcdf.in.NetcdfAdapter)
-
main
public static void main(java.lang.String[] args) throws java.lang.ExceptionTests this class.- Parameters:
args- File pathnames.- Throws:
java.lang.Exception- Something went wrong.
-
-
DMelt 3.0 © DataMelt by jWork.ORG