visad.data.netcdf.in
Class Merger

java.lang.Object
  extended by visad.data.netcdf.in.Merger
Direct Known Subclasses:
FlatMerger

public class Merger
extends Object

Provides support for merging of virtual data objects. This class merges virtual data objects to the maximum extent possible.

Author:
Steven R. Emmerson

Constructor Summary
protected Merger()
          Constructs from nothing.
 
Method Summary
static Merger instance()
          Returns an instance of this class.
 VirtualData merge(VirtualData data1, VirtualData data2)
          Merges two virtual data objects.
protected  VirtualField merge(VirtualField field, VirtualData data)
          Merges a virtual field with another virtual data object.
protected  VirtualField merge(VirtualField field1, VirtualField field2)
          Merges a virtual field with another virtual field.
protected  VirtualField merge(VirtualFlatField field, VirtualData data)
          Merges a virtual flat-field with another virtual data object.
protected  VirtualField merge(VirtualFlatField field1, VirtualField field2)
          Merges a virtual flat-field with a virtual field.
protected  VirtualFlatField merge(VirtualFlatField field1, VirtualFlatField field2)
          Merges a virtual flat-field with another virtual flat-field.
protected  VirtualTuple merge(VirtualTuple tuple, VirtualData data)
          Merges a virtual tuple with another virtual data object.
protected  VirtualTuple merge(VirtualTuple tuple1, VirtualTuple tuple2)
          Merges two virtual tuples.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Merger

protected Merger()
Constructs from nothing.

Method Detail

instance

public static Merger instance()
Returns an instance of this class.

Returns:
An instance of this class.

merge

public VirtualData merge(VirtualData data1,
                         VirtualData data2)
                  throws VisADException
Merges two virtual data objects. The order of the objects sub-components is preserved.

Parameters:
data1 - The first virtual data object.
data2 - The second virtual data object.
Returns:
A virtual data object comprising the ordered merger of the two virtual data objects if possible; otherwise null. May be one of the input objects. throws VisADException VisAD failure.
Throws:
VisADException

merge

protected VirtualTuple merge(VirtualTuple tuple,
                             VirtualData data)
                      throws VisADException
Merges a virtual tuple with another virtual data object. Order is preserved.

Parameters:
tuple - The virtual tuple.
data - The other virtual data object.
Returns:
tuple. throws VisADException VisAD failure.
Throws:
VisADException

merge

protected VirtualTuple merge(VirtualTuple tuple1,
                             VirtualTuple tuple2)
                      throws VisADException
Merges two virtual tuples.

Parameters:
tuple1 - The first virtual tuple.
tuple2 - The second virtual tuple.
Returns:
tuple1. throws VisADException VisAD failure.
Throws:
VisADException

merge

protected VirtualField merge(VirtualField field,
                             VirtualData data)
                      throws VisADException
Merges a virtual field with another virtual data object. Order is preserved.

Parameters:
field - The virtual field.
data - The other virtual data object.
Returns:
A virtual field comprising the merger of the input objects if possible; otherwise null. May be field. throws VisADException VisAD failure.
Throws:
VisADException

merge

protected VirtualField merge(VirtualField field1,
                             VirtualField field2)
                      throws VisADException
Merges a virtual field with another virtual field. Order is preserved.

Parameters:
field1 - The first virtual field.
field2 - The second virtual field.
Returns:
A virtual field comprising the merger of the input fields if possible; otherwise null. May be field1. throws VisADException VisAD failure.
Throws:
VisADException

merge

protected VirtualField merge(VirtualFlatField field,
                             VirtualData data)
                      throws VisADException
Merges a virtual flat-field with another virtual data object. Order is preserved.

Parameters:
field - The virtual flat-field.
data - The other virtual data object.
Returns:
A virtual field comprising the merger of the input objects if possible; otherwise null. May be field. throws VisADException VisAD failure.
Throws:
VisADException

merge

protected VirtualField merge(VirtualFlatField field1,
                             VirtualField field2)
                      throws VisADException
Merges a virtual flat-field with a virtual field. Simply uses merge(VirtualField, VirtualField). This method may be overridden by subclasses.

Parameters:
field1 - The virtual flat-field.
field2 - The virtual field.
Returns:
A virtual field comprising the merger of the input objects if possible; otherwise null. throws VisADException VisAD failure.
Throws:
VisADException
See Also:
merge(VirtualField, VirtualField)

merge

protected VirtualFlatField merge(VirtualFlatField field1,
                                 VirtualFlatField field2)
                          throws VisADException
Merges a virtual flat-field with another virtual flat-field. Simply uses merge(VirtualFlatField, VirtualFlatField). This method may be overridden by subclasses.

Parameters:
field1 - The virtual flat-field.
field2 - The other virtual flat-field.
Returns:
A virtual flat-field comprising the merger of the input objects if possible; otherwise null. May be field1. throws VisADException VisAD failure.
Throws:
VisADException
See Also:
merge(VirtualFlatField, VirtualFlatField)