Documentation of 'visad.data.netcdf.Plain' Java class
Plain
visad.data.netcdf

Class Plain

  • All Implemented Interfaces:
    FormFileInformer


    public class Plain
    extends NetCDF
    A moderately stupid implementation of a netCDF data form for the storage of persistent data objects on local disk.
    • Constructor Summary

      Constructors 
      Constructor and Description
      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

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void add(java.lang.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(java.lang.String[] args)
      Test this class.
      DataImpl open(java.lang.String spec)
      Returns a VisAD data object corresponding to a netCDF dataset.
      DataImpl open(java.lang.String spec, Strategy strategy)
      Returns a VisAD data object corresponding to a netCDF dataset and imported according to a given strategy.
      DataImpl open(java.net.URL url)
      Returns a VisAD data object corresponding to a URL.
      DataImpl openProxy(java.lang.String path)
      Open an existing netCDF file and return a proxy for a VisAD data object.
      void save(java.lang.String path, Data data, boolean replace)
      Save a VisAD data object in this form.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Plain

        public Plain()
              throws VisADException
        Constructs a default, netCDF data form.
        Throws:
        VisADException - Couldn't create necessary VisAD object
      • Plain

        public Plain(boolean charToText)
        Constructs a netCDF data form that converts
        Parameters:
        charToText - The char to Text flag
      • Plain

        public Plain(QuantityDB db)
        Constructs a netCDF data form that uses the given quantity database.
        Parameters:
        db - The quantity database.
      • Plain

        public Plain(QuantityDB db,
                     boolean charToText)
        Constructs a netCDF data form that uses the given quantity database, and the flag for converting char to Text.
        Parameters:
        db - The quantity database.
        charToText - The char to Text flag
    • Method Detail

      • save

        public void save(java.lang.String path,
                         Data data,
                         boolean replace)
                  throws BadFormException,
                         java.io.IOException,
                         java.rmi.RemoteException,
                         VisADException,
                         UnimplementedException
        Save a VisAD data object in this form.
        Specified by:
        save in class FormNode
        Parameters:
        path - The pathname of the netCDF file to be created.
        data - The data to be saved.
        replace - Whether to replace an existing file.
        Throws:
        BadFormException - netCDF can't handle data object
        VisADException - Couldn't create necessary VisAD object
        java.io.IOException - I/O error. File might already exist.
        java.rmi.RemoteException - Remote execution error
        UnimplementedException - Not yet!
      • add

        public void add(java.lang.String id,
                        Data data,
                        boolean replace)
                 throws BadFormException
        Add data to an existing data object.
        Specified by:
        add in class FormNode
        Parameters:
        id - Pathname of the existing netCDF file.
        data - Data to be saved.
        replace - Whether or not to replace duplicate, existing data.
        Throws:
        BadFormException - netCDF can't handle data object.
      • open

        public DataImpl open(java.lang.String spec)
                      throws BadFormException,
                             java.io.IOException,
                             VisADException
        Returns a VisAD data object corresponding to a netCDF dataset.
        Specified by:
        open in class NetCDF
        Parameters:
        spec - Specification of the existing netCDF dataset.
        Returns:
        A VisAD data object corresponding to the netCDF dataset.
        Throws:
        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.
        java.io.IOException - if an I/O failure occurs.
        See Also:
        NetcdfAdapter.getData()
      • openProxy

        public DataImpl openProxy(java.lang.String path)
                           throws BadFormException,
                                  java.io.IOException,
                                  VisADException
        Open an existing netCDF file and return a proxy for a VisAD data object.
        Parameters:
        path - Pathname of the existing netCDF file.
        Returns:
        A VisAD object corresponding to the netCDF dataset.
        Throws:
        BadFormException - The netCDF variable cannot be adapted to a VisAD API.
        VisADException - Problem in core VisAD. Probably some VisAD object couldn't be created.
        java.io.IOException - Data access I/O failure.
      • open

        public DataImpl open(java.net.URL url)
                      throws java.io.FileNotFoundException,
                             java.io.IOException,
                             VisADException
        Returns a VisAD data object corresponding to a URL. If the query component of the URL is 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.
        Specified by:
        open in class FormNode
        Parameters:
        url - The URL of the netCDF dataset.
        Returns:
        A VisAD object corresponding to the netCDF datset or null.
        Throws:
        java.io.FileNotFoundException - if the URL specifies a file that doesn't exist.
        java.io.IOException - if an I/O failure occurs.
        VisADException - if a necessary VisAD object couldn't be created.
      • getForms

        public FormNode getForms(Data data)
                          throws VisADException,
                                 java.rmi.RemoteException,
                                 java.io.IOException
        Return the data forms that are compatible with a data object.
        Specified by:
        getForms in class FormNode
        Parameters:
        data - The VisAD data object to be examined.
        Returns:
        this if data is compatible; otherwise, null.
        Throws:
        VisADException - Problem with core VisAD.
        java.io.IOException - Problem with local data access.
        java.rmi.RemoteException - Problem with remote data access.
      • main

        public static void main(java.lang.String[] args)
                         throws java.lang.Exception
        Test this class.
        Parameters:
        args - Runtime arguments. Ignored.
        Throws:
        java.lang.Exception - Something went wrong.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.