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 |
DefaultFamily(String name)
Construct a family of the supported VisAD datatype Forms |
DefaultFamily(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 |
static void |
addFormToList(FormNode form)
Add a Form to the list of supported VisAD datatype Forms. |
static void |
main(String[] args)
Test the DefaultFamily class |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultFamily
public DefaultFamily(String name)
- Construct a family of the supported VisAD datatype Forms
DefaultFamily
public DefaultFamily(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.
addFormToList
public static void addFormToList(FormNode form)
throws 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 standard
GIFForm
.
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:
ArrayIndexOutOfBoundsException
- If there is no more room in the list.
main
public static void main(String[] args)
throws BadFormException,
IOException,
RemoteException,
VisADException
- Test the DefaultFamily class
- Throws:
BadFormException
IOException
RemoteException
VisADException