ucar.nc2.ft.point.standard
Class Table

java.lang.Object
  extended by ucar.nc2.ft.point.standard.Table
Direct Known Subclasses:
Table.TableArrayStructure, Table.TableConstruct, Table.TableMultiDimInner, Table.TableNestedStructure, Table.TableSingleton, Table.TableStructure, Table.TableTop

public abstract class Table
extends java.lang.Object

A generalization of a Structure. Main function is to return a StructureDataIterator, iterating over its table rows

Since:
Jan 20, 2009
Author:
caron

Nested Class Summary
static class Table.CoordName
           
static class Table.TableArrayStructure
          ArrayStructure is passed in config.as Used by UnidataPointFeature: type StationProfile (deprecated)
static class Table.TableConstruct
          When theres no seperate station table, but info is duplicated in the obs structure.
static class Table.TableContiguous
          Contiguous children, using start and numRecords variables in the parent.
static class Table.TableLinkedList
          Linked list of children, using start variable in the parent, and next in the child.
static class Table.TableMultiDimInner
          A collection of Multdimensional Variables:

Variable stn(outDim) Variable v1(outDim, innerDim, ...) Variable v2(outDim, innerDim)

can be thought of as a structure:

Structure { stn; v1(innerDim, ...) v2(innerDim); } so(outerDim);

and as nested structures:

Structure { stn; Structure { v1(...), v2 } si(innerDim); } so(outerDim);

1) When outerDim is the record variable, (ie it really is a structure) it makes sense to read the entire record at once:

Structure { v1(innerDim, ...) v2(innerDim); stn; } so(outerDim);

and return the StructureData with the inner variables removed:

StructureData { stn1; stn2 } so(outerDim);

LOOK (This may be hard, when is subset done ?? since inner need access to other members)

And for the inner iterator, given the original StructureData for outerDim=fixed

StructureData { v1(innerDim, ...) v2(innerDim); stn; } so(outerDim=fixed);

rearrange it into an ArrayStructure:

ArrayStructure(innerDim) { StructureData { v1(...); v2; } }

Use Table types MultdimOuter, MultidimInner for this case

2) When its not, it makes sense to read the outer variables seperately:

outer iterator is over outDim

Variable stn1(outDim) Variable stn2(outDim)

inner iterator over innerDim:

Variable v1(outDim=fixed, innerDim, ...) Variable v2(outDim=fixed, innerDim)

Use Table types Structure(psuedo, with vars set), TableMultiDimStructure (psuedo) for this case

static class Table.TableMultiDimStructure
          Used for Structure(station, time).
static class Table.TableMultiDimStructurePsuedo
          Used for PsuedoStructure(station, time).
static class Table.TableNestedStructure
          A Structure inside of a parent Structure.
static class Table.TableParentIndex
          The children have a parentIndex, child -> parent.
static class Table.TableSingleton
          Table is a single StructureData, passed in as config.sdata.
static class Table.TableStructure
          A Structure or PsuedoStructure.
static class Table.TableTop
          Table is a single StructureData, which is empty.
static class Table.Type
           
 
Constructor Summary
protected Table(NetcdfDataset ds, TableConfig config)
           
 
Method Summary
static Table factory(NetcdfDataset ds, TableConfig config)
           
 Variable findVariable(java.lang.String axisName)
           
 java.util.List<? super VariableSimpleIF> getDataVariables()
           
 FeatureType getFeatureType()
           
 java.lang.String getName()
           
abstract  StructureDataIterator getStructureDataIterator(Cursor cursor, int bufferSize)
          Iterate over the rows of this table.
 int show(java.util.Formatter f, int indent)
           
 java.lang.String showAll()
           
 java.lang.String showDimension()
           
protected abstract  void showTableExtraInfo(java.lang.String indent, java.util.Formatter f)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Table

protected Table(NetcdfDataset ds,
                TableConfig config)
Method Detail

factory

public static Table factory(NetcdfDataset ds,
                            TableConfig config)

getStructureDataIterator

public abstract StructureDataIterator getStructureDataIterator(Cursor cursor,
                                                               int bufferSize)
                                                        throws java.io.IOException
Iterate over the rows of this table. Subclasses must implement this.

Parameters:
cursor - state of comlpete iteration. Table implementations may not modify.
bufferSize - hit on how much memory (in bytes) can be used to buffer.
Returns:
iterater over the rows of this table.
Throws:
java.io.IOException - on read error

getName

public java.lang.String getName()

getFeatureType

public FeatureType getFeatureType()

getDataVariables

public java.util.List<? super VariableSimpleIF> getDataVariables()

findVariable

public Variable findVariable(java.lang.String axisName)

showDimension

public java.lang.String showDimension()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

showAll

public java.lang.String showAll()

show

public int show(java.util.Formatter f,
                int indent)

showTableExtraInfo

protected abstract void showTableExtraInfo(java.lang.String indent,
                                           java.util.Formatter f)