visad.data.visad
Class VisADForm

java.lang.Object
  extended by visad.data.FormNode
      extended by visad.data.Form
          extended by visad.data.visad.VisADForm
All Implemented Interfaces:
FormFileInformer
Direct Known Subclasses:
VisADCachingForm, VisADSerialForm

public class VisADForm
extends Form
implements FormFileInformer

VisADForm is the VisAD data format adapter for binary visad.Data objects.


Field Summary
 
Fields inherited from class visad.data.Form
mathType
 
Constructor Summary
VisADForm()
          Read/write a VisAD Data object using Java serialization.
VisADForm(boolean allowBinary)
          If allowBinary is true, read/write a VisAD Data object in VisAD's binary file format.

If allowBinary is false, read/write a VisAD Data object using Java serialization.
 
Method Summary
 void add(java.lang.String id, Data data, boolean replace)
          Add data to an existing data object.
 java.lang.String[] getDefaultSuffixes()
           
 FormNode getForms(Data data)
          Return the data forms that are compatible with a data object.
 boolean isThisType(byte[] block)
           
 boolean isThisType(java.lang.String name)
           
static void main(java.lang.String[] args)
          run 'java visad.data.visad.VisADForm in_file out_file' to convert in_file to out_file in VisAD serialized data format
 DataImpl open(java.lang.String id)
          Open an existing data object.
 DataImpl open(java.net.URL url)
          Open a data object specified as a URL.
 void save(java.lang.String id, Data data, boolean replace)
          Save a Data object.
 void save(java.lang.String id, Data data, boolean replace, boolean bigObject)
          Save a Data object.
 
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

VisADForm

public VisADForm(boolean allowBinary)
If allowBinary is true, read/write a VisAD Data object in VisAD's binary file format.

If allowBinary is false, read/write a VisAD Data object using Java serialization.

Parameters:
allowBinary - if true use VisAD's binary file format, otherwise use Java serialization.

VisADForm

public VisADForm()
Read/write a VisAD Data object using Java serialization.

Method Detail

isThisType

public boolean isThisType(java.lang.String name)
Specified by:
isThisType in interface FormFileInformer

isThisType

public boolean isThisType(byte[] block)
Specified by:
isThisType in interface FormFileInformer

getDefaultSuffixes

public java.lang.String[] getDefaultSuffixes()
Specified by:
getDefaultSuffixes in interface FormFileInformer

add

public void add(java.lang.String id,
                Data data,
                boolean replace)
         throws BadFormException
Description copied from class: FormNode
Add data to an existing data object.

Specified by:
add in class FormNode
Throws:
BadFormException

getForms

public FormNode getForms(Data data)
Description copied from class: FormNode
Return the data forms that are compatible with a data object.

Specified by:
getForms in class FormNode

open

public DataImpl open(java.lang.String id)
              throws BadFormException,
                     java.io.IOException,
                     VisADException
Description copied from class: FormNode
Open an existing data object.

Specified by:
open in class FormNode
Throws:
BadFormException
java.io.IOException
VisADException

open

public DataImpl open(java.net.URL url)
              throws BadFormException,
                     java.io.IOException,
                     VisADException
Description copied from class: FormNode
Open a data object specified as a URL.

Specified by:
open in class FormNode
Throws:
BadFormException
java.io.IOException
VisADException

save

public void save(java.lang.String id,
                 Data data,
                 boolean replace)
          throws BadFormException,
                 java.io.IOException,
                 java.rmi.RemoteException,
                 VisADException
Save a Data object.

Specified by:
save in class FormNode
Parameters:
id - file name
data - Data object
replace - true if any existing file should be overwritten
Throws:
BadFormException
java.io.IOException
java.rmi.RemoteException
VisADException

save

public void save(java.lang.String id,
                 Data data,
                 boolean replace,
                 boolean bigObject)
          throws BadFormException,
                 java.io.IOException,
                 java.rmi.RemoteException,
                 VisADException
Save a Data object.

Parameters:
id - file name
data - Data object
replace - true if any existing file should be overwritten
bigObject - true if the Data object is larger than the computer's memory, in which case special measures will be taken to converse memory usage.
Throws:
BadFormException
java.io.IOException
java.rmi.RemoteException
VisADException

main

public static void main(java.lang.String[] args)
                 throws VisADException,
                        java.rmi.RemoteException,
                        java.io.IOException
run 'java visad.data.visad.VisADForm in_file out_file' to convert in_file to out_file in VisAD serialized data format

Throws:
VisADException
java.rmi.RemoteException
java.io.IOException