visad.data.vis5d
Class Vis5DTopoForm

java.lang.Object
  extended by visad.data.FormNode
      extended by visad.data.Form
          extended by visad.data.vis5d.Vis5DTopoForm
All Implemented Interfaces:
FormFileInformer

public class Vis5DTopoForm
extends Form
implements FormFileInformer

Vis5DTopoForm is the VisAD data format adapter for Vis5D topography files.


Field Summary
 
Fields inherited from class visad.data.Form
mathType
 
Constructor Summary
Vis5DTopoForm()
          Create a new Vis5DTopoForm
 
Method Summary
 void add(String id, Data data, boolean replace)
          Add data to an existing data object.
 String[] getDefaultSuffixes()
          Get default suffixes for Vis5D topography files
 FormNode getForms(Data data)
          Return the data forms that are compatible with a data object.
 boolean isThisType(byte[] block)
          Check to see if the block contains the magic number
 boolean isThisType(String name)
          Check to see if the file name might be right for this form.
 DataImpl open(InputStream in)
          Returns a VisAD data object corresponding to an input stream for a Vis5DTopography file.
 DataImpl open(String id)
          Returns a VisAD data object corresponding to a Vis5D topography file.
 DataImpl open(URL url)
          Returns a VisAD data object corresponding to a URL pointing to a Vis5D topography file.
 void save(String id, Data data, boolean replace)
          Save a VisAD data object in this form.
 
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

Vis5DTopoForm

public Vis5DTopoForm()
Create a new Vis5DTopoForm

Method Detail

isThisType

public boolean isThisType(String name)
Check to see if the file name might be right for this form.

Specified by:
isThisType in interface FormFileInformer
Parameters:
name - name of the file
Returns:
true if it might be a Vis5D topography file based on the name.

isThisType

public boolean isThisType(byte[] block)
Check to see if the block contains the magic number

Specified by:
isThisType in interface FormFileInformer
Parameters:
block - block of bytes from file
Returns:
true if the first 4 bytes correspond to "TOPO"

getDefaultSuffixes

public String[] getDefaultSuffixes()
Get default suffixes for Vis5D topography files

Specified by:
getDefaultSuffixes in interface FormFileInformer
Returns:
array of suffixes (.v5d, .TOPO)

save

public void save(String id,
                 Data data,
                 boolean replace)
          throws BadFormException,
                 IOException,
                 RemoteException,
                 VisADException
Save a VisAD data object in this form.

Specified by:
save in class FormNode
Parameters:
id - file id
data - Data object to save
replace - true to replace the existing file
Throws:
UnimplementedException - not implemented for this form
BadFormException
IOException
RemoteException
VisADException

add

public void add(String id,
                Data data,
                boolean replace)
         throws BadFormException
Add data to an existing data object.

Specified by:
add in class FormNode
Parameters:
id - file id
data - Data object to append to
replace - true to replace the existing file
Throws:
BadFormException - not applicable to this form

getForms

public FormNode getForms(Data data)
Return the data forms that are compatible with a data object.

Specified by:
getForms in class FormNode
Parameters:
data - Data object in question
Returns:
null for this Form since it doesn't support save.

open

public DataImpl open(URL url)
              throws BadFormException,
                     VisADException,
                     IOException
Returns a VisAD data object corresponding to a URL pointing to a Vis5D topography file.

Specified by:
open in class FormNode
Parameters:
url - URL pointing to the Vis5D topography
Returns:
A VisAD data object corresponding to the Vis5D topography file.
Throws:
BadFormException - if not a Vis5D topo file.
VisADException - if a problem occurs in core VisAD. Probably a VisAD object couldn't be created.
IOException - if an I/O failure occurs.

open

public DataImpl open(String id)
              throws BadFormException,
                     IOException,
                     VisADException
Returns a VisAD data object corresponding to a Vis5D topography file.

Specified by:
open in class FormNode
Parameters:
id - path to the existing Vis5D file.
Returns:
A VisAD data object corresponding to the Vis5D dataset.
Throws:
BadFormException - if not a Vis5D topo file.
VisADException - if a problem occurs in core VisAD. Probably a VisAD object couldn't be created.
IOException - if an I/O failure occurs.

open

public DataImpl open(InputStream in)
              throws BadFormException,
                     IOException,
                     VisADException
Returns a VisAD data object corresponding to an input stream for a Vis5DTopography file.

Parameters:
in - Input stream
Returns:
A VisAD data object corresponding to the Vis5D topo file.
Throws:
BadFormException - if not a Vis5D topo file.
VisADException - if a problem occurs in core VisAD. Probably a VisAD object couldn't be created.
IOException - if an I/O failure occurs.