ucar.netcdf
Class NetcdfWrapper

java.lang.Object
  extended by ucar.netcdf.NetcdfWrapper
All Implemented Interfaces:
Netcdf

public abstract class NetcdfWrapper
extends java.lang.Object
implements Netcdf

Abstract "decorator" class for wrapping a Netcdf object. All method invocations of the Netcdf API are forwarded to a contained Netcdf object. This class is designed to be extended.


Constructor Summary
protected NetcdfWrapper(Netcdf netcdf)
          Constructs from a netCDF object.
 
Method Summary
 boolean contains(java.lang.Object oo)
          Tests an object is in this dataset.
 boolean contains(java.lang.String name)
          Tests if the Variable identified by name is in this dataset.
 Variable get(java.lang.String name)
          Retrieve the variable associated with a name.
 Attribute getAttribute(java.lang.String name)
          Returns a global, netCDF attribute by name.
 AttributeSet getAttributes()
          Returns the set of global, netCDF attributes in this dataset.
 DimensionSet getDimensions()
          Returns all the netCDF dimensions in this dataset.
 Netcdf getNetcdf()
          Returns the wrapped Netcdf object.
 VariableIterator iterator()
          Returns an iterator over the variables.
 int size()
          Returns the number of variables.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetcdfWrapper

protected NetcdfWrapper(Netcdf netcdf)
                 throws java.lang.NullPointerException
Constructs from a netCDF object.

Parameters:
netcdf - The netCDF dataset to be wrapped.
NullPointerException - if the argument is null.
Throws:
java.lang.NullPointerException
Method Detail

getNetcdf

public final Netcdf getNetcdf()
Returns the wrapped Netcdf object.

Returns:
The wrapped, Netcdf object.

size

public int size()
Returns the number of variables.

Specified by:
size in interface Netcdf
Returns:
The number of variables

iterator

public VariableIterator iterator()
Returns an iterator over the variables.

Specified by:
iterator in interface Netcdf
Returns:
An iterator over the variables.
See Also:
VariableIterator

get

public Variable get(java.lang.String name)
Retrieve the variable associated with a name. If no such variable exists, then null is returned.

Specified by:
get in interface Netcdf
Parameters:
name - Name of the desired variable.
Returns:
The variable or null.

contains

public boolean contains(java.lang.String name)
Tests if the Variable identified by name is in this dataset.

Specified by:
contains in interface Netcdf
Parameters:
name - Name of the desired variable.
Returns:
true if and only if this dataset contains the named variable.

contains

public boolean contains(java.lang.Object oo)
Tests an object is in this dataset.

Specified by:
contains in interface Netcdf
Parameters:
oo - An object.
Returns:
true if and only if this dataset contains oo.

getDimensions

public DimensionSet getDimensions()
Returns all the netCDF dimensions in this dataset.

Specified by:
getDimensions in interface Netcdf
Returns:
The union of all dimensions of all variables. May be empty.

getAttributes

public AttributeSet getAttributes()
Returns the set of global, netCDF attributes in this dataset.

Specified by:
getAttributes in interface Netcdf
Returns:
All global attributes in this dataset. May be empty.

getAttribute

public Attribute getAttribute(java.lang.String name)
Returns a global, netCDF attribute by name. If no such attribute exists, then null is returned.

Specified by:
getAttribute in interface Netcdf
Parameters:
The - name of the attribute.
Returns:
The attribute or null.