visad.data.dods
Class DODSSource

java.lang.Object
  extended by visad.data.dods.DODSSource
All Implemented Interfaces:
DataInputSource, DataInputStream

public class DODSSource
extends Object
implements DataInputSource

Provides support for generating a stream of VisAD data objects from a DODS dataset.

Instances are mutable.

Author:
Steven R. Emmerson

Constructor Summary
DODSSource()
          Constructs from nothing.
DODSSource(DataFactory factory)
          Constructs from a factory for creating VisAD data objects.
 
Method Summary
 void open(String spec)
          Opens an existing DODS dataset.
protected  DataImpl readAttribute(String name)
          Returns a VisAD data object corresponding to the next DODS global attribute in the currently open dataset.
 DataImpl readData()
          Returns the next VisAD data object from the DODS dataset.
protected  DataImpl readVariable()
          Returns a VisAD data object corresponding to the next DODS variable in the currently open dataset.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DODSSource

public DODSSource()
Constructs from nothing. The default factory for creating VisAD data objects will be used.


DODSSource

public DODSSource(DataFactory factory)
Constructs from a factory for creating VisAD data objects.

Parameters:
factory - A factory for creating VisAD data objects.
Method Detail

open

public void open(String spec)
          throws BadFormException,
                 RemoteException,
                 VisADException
Opens an existing DODS dataset.

Specified by:
open in interface DataInputSource
Parameters:
spec - The URL string specification of the DODS dataset The path component should have a ".dods" suffix.
Throws:
BadFormException - The DODS dataset is corrupt.
VisADException - VisAD failure.
RemoteException - Java RMI failure.

readData

public DataImpl readData()
                  throws VisADException,
                         RemoteException
Returns the next VisAD data object from the DODS dataset. Returns null if there is no more objects.

Specified by:
readData in interface DataInputStream
Returns:
A VisAD data object or null if there are no more such objects.
Throws:
VisADException - VisAD failure.
RemoteException - Java RMI failure.

readAttribute

protected DataImpl readAttribute(String name)
                          throws BadFormException,
                                 VisADException,
                                 RemoteException
Returns a VisAD data object corresponding to the next DODS global attribute in the currently open dataset. Returns null if there isn't another attribute.

Parameters:
name - The name of the attribute.
Returns:
A VisAD data object corresponding to the next DODS global attribute or null if no more attributes.
Throws:
BadFormException - The DODS datset is corrupt.
VisADException - VisAD failure.
RemoteException - Java RMI failure.

readVariable

protected DataImpl readVariable()
                         throws BadFormException,
                                VisADException,
                                RemoteException
Returns a VisAD data object corresponding to the next DODS variable in the currently open dataset. Returns null if there isn't another variable.

Returns:
A VisAD data object corresponding to the next DODS variable or null if no more variables.
Throws:
BadFormException - The DODS datset is corrupt.
VisADException - VisAD failure.
RemoteException - Java RMI failure.