|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object visad.data.FormNode visad.data.Form visad.data.netcdf.NetCDF visad.data.netcdf.Plain
public class Plain
A moderately stupid implementation of a netCDF data form for the storage of persistent data objects on local disk.
Field Summary |
---|
Fields inherited from class visad.data.Form |
---|
mathType |
Constructor Summary | |
---|---|
Plain()
Constructs a default, netCDF data form. |
|
Plain(boolean charToText)
Constructs a netCDF data form that converts |
|
Plain(QuantityDB db)
Constructs a netCDF data form that uses the given quantity database. |
|
Plain(QuantityDB db,
boolean charToText)
Constructs a netCDF data form that uses the given quantity database, and the flag for converting char to Text. |
Method Summary | |
---|---|
void |
add(String id,
Data data,
boolean replace)
Add data to an existing data object. |
FormNode |
getForms(Data data)
Return the data forms that are compatible with a data object. |
static void |
main(String[] args)
Test this class. |
DataImpl |
open(String spec)
Returns a VisAD data object corresponding to a netCDF dataset. |
DataImpl |
open(String spec,
Strategy strategy)
Returns a VisAD data object corresponding to a netCDF dataset and imported according to a given strategy. |
DataImpl |
open(URL url)
Returns a VisAD data object corresponding to a URL. |
DataImpl |
openProxy(String path)
Open an existing netCDF file and return a proxy for a VisAD data object. |
void |
save(String path,
Data data,
boolean replace)
Save a VisAD data object in this form. |
Methods inherited from class visad.data.netcdf.NetCDF |
---|
getDefaultSuffixes, isThisType, isThisType |
Methods inherited from class visad.data.Form |
---|
getMathType |
Methods inherited from class visad.data.FormNode |
---|
getName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Plain() throws VisADException
VisADException
- Couldn't create necessary VisAD objectpublic Plain(boolean charToText)
charToText
- The char to Text flagpublic Plain(QuantityDB db)
db
- The quantity database.public Plain(QuantityDB db, boolean charToText)
db
- The quantity database.charToText
- The char to Text flagMethod Detail |
---|
public void save(String path, Data data, boolean replace) throws BadFormException, IOException, RemoteException, VisADException, UnimplementedException
save
in class FormNode
path
- The pathname of the netCDF file to
be created.data
- The data to be saved.replace
- Whether to replace an existing file.
BadFormException
- netCDF can't handle data object
VisADException
- Couldn't create necessary VisAD object
IOException
- I/O error. File might already exist.
RemoteException
- Remote execution error
UnimplementedException
- Not yet!public void add(String id, Data data, boolean replace) throws BadFormException
add
in class FormNode
id
- Pathname of the existing netCDF file.data
- Data to be saved.replace
- Whether or not to replace duplicate, existing data.
BadFormException
- netCDF can't handle data object.public DataImpl open(String spec) throws BadFormException, IOException, VisADException
open
in class NetCDF
spec
- Specification of the existing netCDF dataset.
BadFormException
- if the netCDF dataset cannot be adapted to a
VisAD data object.
VisADException
- if a problem occurs in core VisAD. Probably a
VisAD object couldn't be created.
IOException
- if an I/O failure occurs.NetcdfAdapter.getData()
public DataImpl open(String spec, Strategy strategy) throws BadFormException, IOException, VisADException
Strategy.DEFAULT
,
Strategy.MERGED_FILE_FLAT_FIELDS
, Strategy.UNMERGED_FILE_FLAT_FIELDS
, and Strategy.IN_MEMORY
.
spec
- Specification of the existing netCDF dataset.strategy
- The data-import strategy.
BadFormException
- if the netCDF dataset cannot be adapted to a
VisAD data object.
VisADException
- if a problem occurs in core VisAD. Probably a
VisAD object couldn't be created.
IOException
- if an I/O failure occurs.NetcdfAdapter.getData(Strategy)
public DataImpl openProxy(String path) throws BadFormException, IOException, VisADException
path
- Pathname of the existing netCDF file.
BadFormException
- The netCDF variable cannot be adapted to a VisAD API.
VisADException
- Problem in core VisAD. Probably some VisAD object
couldn't be created.
IOException
- Data access I/O failure.public DataImpl open(URL url) throws FileNotFoundException, IOException, VisADException
null
, then the returned object will
contain all the variables in the netCDF dataset. If the query component
is non-null
, then it must comprise a comma-separated list of
netCDF variable names; the returned VisAD data object will contain only
those variables in the netCDF dataset that are also named in the list
(i.e. the intersection is returned). Consequently, if the list is empty,
then null
is returned. For example, this form:
open(new URL("file://myfile.nc?var_one,var_two"));
will return a VisAD data object consisting only of the
netCDF variables var_one
and var_two
assuming they are in the file.
open
in class FormNode
url
- The URL of the netCDF dataset.
null
.
FileNotFoundException
- if the URL specifies a file that doesn't exist.
IOException
- if an I/O failure occurs.
VisADException
- if a necessary VisAD object couldn't be created.public FormNode getForms(Data data) throws VisADException, RemoteException, IOException
getForms
in class FormNode
data
- The VisAD data object to be examined.
this
if data
is compatible;
otherwise, null
.
VisADException
- Problem with core VisAD.
IOException
- Problem with local data access.
RemoteException
- Problem with remote data access.public static void main(String[] args) throws Exception
args
- Runtime arguments. Ignored.
Exception
- Something went wrong.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |