|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucar.netcdf.AbstractNetcdf
public abstract class AbstractNetcdf
This abstract class provides a skeletal implementation of the Netcdf interface.
A minimal concrete implementation
would provide a concrete implementation of method
Accessor ioFactory(ProtoVariable proto)
.
It would also provide a constructor which takes a Schema
argument and calls super(Schema) to get this class to
hook everything up.
TODO: There is a lot more to be said.
Constructor Summary | |
---|---|
protected |
AbstractNetcdf()
Create an empty instance. |
protected |
AbstractNetcdf(java.lang.Class varClass)
Create an empty instance to be populated with instances of some subclass of Variable. |
protected |
AbstractNetcdf(Schema sc,
boolean init)
Create an instance populated with instances of Variable. |
protected |
AbstractNetcdf(Schema sc,
boolean init,
java.lang.Class varClass)
Create an instance populated with instances of some subclass of Variable. |
Method Summary | |
---|---|
protected void |
add(ProtoVariable proto,
Accessor io)
Used for incremental initialization. |
boolean |
contains(java.lang.Object oo)
Tests if the argument is in this set. |
boolean |
contains(java.lang.String name)
Tests if the Variable identified by name
is in this set. |
Variable |
get(java.lang.String name)
Retrieve the variable associated with the specified name. |
Attribute |
getAttribute(java.lang.String name)
Convenience function; look up global Attribute by name. |
AttributeSet |
getAttributes()
Returns the set of attributes associated with this, also know as the "global" attributes. |
DimensionSet |
getDimensions()
Returns the set of dimensions associated with this, the union of those used by each of the variables. |
protected void |
initHashtable()
|
protected abstract Accessor |
ioFactory(ProtoVariable proto)
Used when creating variables to populate this. |
VariableIterator |
iterator()
Returns VariableIterator for the elements. |
protected void |
putAttribute(Attribute attr)
Used for incremental initialization. |
protected void |
putDimension(Dimension dim)
Used for incremental initialization. |
int |
size()
Returns the number of variables |
void |
toCdl(java.lang.StringBuffer buf)
Format as CDL. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected AbstractNetcdf()
protected AbstractNetcdf(java.lang.Class varClass) throws java.lang.NoSuchMethodException
varClass
- Class object for some subclass of Variable.
The class must implement a constructor of the form
myVar(ProtoVariable proto, Accessor io)
or NoSuchMethodException will be thrown.
java.lang.NoSuchMethodException
protected AbstractNetcdf(Schema sc, boolean init)
sc
- the Schema to use. N.B. Not a copy.
May be empty, shouldn't be null.init
- if true, call initHashtable()protected AbstractNetcdf(Schema sc, boolean init, java.lang.Class varClass) throws java.lang.NoSuchMethodException, java.lang.InstantiationException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
sc
- the Schema used as a template.
May be empty, shouldn't be null.init
- if true, call initHashtable()varClass
- Class object for some subclass of Variable.
The class must implement a constructor of the form
myVar(ProtoVariable proto, Accessor io)
or NoSuchMethodException will be thrown.
java.lang.NoSuchMethodException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
Method Detail |
---|
public int size()
size
in interface Netcdf
public VariableIterator iterator()
iterator
in interface Netcdf
VariableIterator
public Variable get(java.lang.String name)
get
in interface Netcdf
name
- String which identifies the desired variable
public boolean contains(java.lang.String name)
name
is in this set.
contains
in interface Netcdf
name
- String which identifies the desired variable
true
if and only if this set contains
the named variable.public boolean contains(java.lang.Object oo)
contains
in interface Netcdf
oo
- some Object
true
if and only if this set contains
oo
public DimensionSet getDimensions()
getDimensions
in interface Netcdf
public AttributeSet getAttributes()
getAttributes
in interface Netcdf
public Attribute getAttribute(java.lang.String name)
getAttribute
in interface Netcdf
name
- the name of the attribute
public void toCdl(java.lang.StringBuffer buf)
buf
- StringBuffer into which to writepublic java.lang.String toString()
toString
in class java.lang.Object
protected abstract Accessor ioFactory(ProtoVariable proto) throws java.lang.reflect.InvocationTargetException
java.lang.reflect.InvocationTargetException
protected void putDimension(Dimension dim)
protected void putAttribute(Attribute attr)
protected void add(ProtoVariable proto, Accessor io) throws java.lang.InstantiationException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
protected void initHashtable() throws java.lang.InstantiationException, java.lang.reflect.InvocationTargetException, java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.reflect.InvocationTargetException
java.lang.IllegalAccessException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |