visad.data
Class DefaultFamily
- java.lang.Object
-
- visad.data.FormNode
-
- visad.data.FormFamily
-
- visad.data.FunctionFormFamily
-
- visad.data.DefaultFamily
-
public class DefaultFamily extends FunctionFormFamily
A container for all the officially supported VisAD datatypes.
To read a Data object from a file or URL:
Data data = new DefaultFamily("dflt").open(string);
To save a Data object to a file:
new DefaultFamily("dflt").save("file.nc", data, true);
To add a Data object to an existing file:
new DefaultFamily("dflt").add("file.nc", data, true);
-
-
Constructor Summary
Constructors Constructor and Description DefaultFamily(java.lang.String name)Construct a family of the supported VisAD datatype FormsDefaultFamily(java.lang.String name, boolean netcdfText)Construct a family of the supported VisAD datatype Forms, with a netCDF form that converts char to Text if netcdfText flag is set.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static voidaddFormToList(FormNode form)Add a Form to the list of supported VisAD datatype Forms.static voidmain(java.lang.String[] args)Test the DefaultFamily class-
Methods inherited from class visad.data.FunctionFormFamily
add, open, open, save
-
Methods inherited from class visad.data.FormFamily
addFormNode, getForms
-
-
-
-
Constructor Detail
-
DefaultFamily
public DefaultFamily(java.lang.String name)
Construct a family of the supported VisAD datatype Forms
-
DefaultFamily
public DefaultFamily(java.lang.String name, boolean netcdfText)Construct a family of the supported VisAD datatype Forms, with a netCDF form that converts char to Text if netcdfText flag is set.
-
-
Method Detail
-
addFormToList
public static void addFormToList(FormNode form) throws java.lang.ArrayIndexOutOfBoundsException
Add a Form to the list of supported VisAD datatype Forms. Forms are added to the front of the list, which means that they will take precedence over existing Forms. If, for example, an added Form claims to open files ending in .gif, it will supersede the standardGIFForm. If the added form discovers that it cannot handle a file, it can simply throw an exception and DefaultFamily will pass the file onto the next Form in the list, so any superseded Form will still be able to open the file.- Throws:
java.lang.ArrayIndexOutOfBoundsException- If there is no more room in the list.
-
main
public static void main(java.lang.String[] args) throws BadFormException, java.io.IOException, java.rmi.RemoteException, VisADExceptionTest the DefaultFamily class- Throws:
BadFormExceptionjava.io.IOExceptionjava.rmi.RemoteExceptionVisADException
-
-
DMelt 3.0 © DataMelt by jWork.ORG