ucar.nc2.ft.point.standard
Class TableAnalyzer

java.lang.Object
  extended by ucar.nc2.ft.point.standard.TableAnalyzer

public class TableAnalyzer
extends java.lang.Object

Analyzes the coordinate systems of a dataset to try to identify the Feature Type and the structure of the data. Used by PointDatasetStandardFactory.

Since:
Mar 20, 2008
Author:
caron

Nested Class Summary
 class TableAnalyzer.StationInfo
           
 
Field Summary
protected  java.lang.String conventionName
           
protected  NetcdfDataset ds
           
protected  java.util.Formatter errlog
           
protected  FeatureType ft
           
protected  java.util.List<NestedTable> leaves
           
protected  TableAnalyzer.StationInfo stationInfo
           
protected  java.util.Map<java.lang.String,TableConfig> tableFind
           
protected  java.util.Set<TableConfig> tableSet
           
protected  TableConfigurer tc
           
protected  java.util.Formatter userAdvice
           
 
Constructor Summary
protected TableAnalyzer(NetcdfDataset ds, TableConfigurer tc)
           
 
Method Summary
protected  void addTable(TableConfig t)
           
protected  void addTableRecurse(TableConfig t)
           
protected  void analyze(FeatureType wantFeatureType)
          Make a NestedTable object for the dataset.
static TableAnalyzer factory(TableConfigurer tc, FeatureType wantFeatureType, NetcdfDataset ds)
          Create a TableAnalyser for this dataset with the given TableConfigurer
 boolean featureTypeOk(FeatureType ftype, java.util.Formatter errlog)
           
protected  void findNestedStructures(Structure s, TableConfig parent)
           
protected  Variable findVariableWithAttribute(java.util.List<Variable> list, java.lang.String name, java.lang.String value)
           
 void getDetailInfo(java.util.Formatter sf)
           
 FeatureType getFirstFeatureType()
           
 java.util.List<NestedTable> getFlatTables()
           
 java.lang.String getImplementationName()
           
 java.lang.String getName()
           
 NetcdfDataset getNetcdfDataset()
           
protected  java.util.List<Variable> getStructVars(java.util.List<Variable> vars, Dimension dim)
           
static TableConfigurer getTableConfigurer(FeatureType wantFeatureType, NetcdfDataset ds)
          Find a TableConfigurer for this dataset, if there is one.
 java.lang.String getUserAdvice()
           
static void main(java.lang.String[] args)
           
protected  void makeLeaves()
           
protected  void makeNestedTables()
           
protected  void makeTablesDefault(boolean structAdded)
           
static void registerAnalyzer(java.lang.String conventionName, java.lang.Class c, ucar.nc2.ft.point.standard.TableAnalyzer.ConventionNameOk match)
           
protected  void setConventionUsed(java.lang.String convName)
           
 void showCoordAxes(java.util.Formatter sf)
           
 void showCoordSys(java.util.Formatter sf)
           
 void showNestedTables(java.util.Formatter sf)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tc

protected TableConfigurer tc

ds

protected NetcdfDataset ds

tableFind

protected java.util.Map<java.lang.String,TableConfig> tableFind

tableSet

protected java.util.Set<TableConfig> tableSet

leaves

protected java.util.List<NestedTable> leaves

ft

protected FeatureType ft

userAdvice

protected java.util.Formatter userAdvice

errlog

protected java.util.Formatter errlog

conventionName

protected java.lang.String conventionName

stationInfo

protected TableAnalyzer.StationInfo stationInfo
Constructor Detail

TableAnalyzer

protected TableAnalyzer(NetcdfDataset ds,
                        TableConfigurer tc)
Method Detail

registerAnalyzer

public static void registerAnalyzer(java.lang.String conventionName,
                                    java.lang.Class c,
                                    ucar.nc2.ft.point.standard.TableAnalyzer.ConventionNameOk match)

getTableConfigurer

public static TableConfigurer getTableConfigurer(FeatureType wantFeatureType,
                                                 NetcdfDataset ds)
                                          throws java.io.IOException
Find a TableConfigurer for this dataset, if there is one.

Parameters:
wantFeatureType - want this FeatureType
ds - for this dataset
Returns:
TableConfigurer or null if not found
Throws:
java.io.IOException - on read error

factory

public static TableAnalyzer factory(TableConfigurer tc,
                                    FeatureType wantFeatureType,
                                    NetcdfDataset ds)
                             throws java.io.IOException
Create a TableAnalyser for this dataset with the given TableConfigurer

Parameters:
tc - TableConfigurer, may be null.
wantFeatureType - want this FeatureType
ds - for this dataset
Returns:
TableAnalyser
Throws:
java.io.IOException - on read error

getFlatTables

public java.util.List<NestedTable> getFlatTables()

featureTypeOk

public boolean featureTypeOk(FeatureType ftype,
                             java.util.Formatter errlog)

getName

public java.lang.String getName()

getFirstFeatureType

public FeatureType getFirstFeatureType()

getNetcdfDataset

public NetcdfDataset getNetcdfDataset()

getUserAdvice

public java.lang.String getUserAdvice()

setConventionUsed

protected void setConventionUsed(java.lang.String convName)

analyze

protected void analyze(FeatureType wantFeatureType)
                throws java.io.IOException
Make a NestedTable object for the dataset.

Parameters:
wantFeatureType - want this FeatureType
Throws:
java.io.IOException - on read error

makeTablesDefault

protected void makeTablesDefault(boolean structAdded)
                          throws java.io.IOException
Throws:
java.io.IOException

findNestedStructures

protected void findNestedStructures(Structure s,
                                    TableConfig parent)

addTable

protected void addTable(TableConfig t)

addTableRecurse

protected void addTableRecurse(TableConfig t)

getStructVars

protected java.util.List<Variable> getStructVars(java.util.List<Variable> vars,
                                                 Dimension dim)

makeNestedTables

protected void makeNestedTables()

makeLeaves

protected void makeLeaves()

findVariableWithAttribute

protected Variable findVariableWithAttribute(java.util.List<Variable> list,
                                             java.lang.String name,
                                             java.lang.String value)

showCoordSys

public void showCoordSys(java.util.Formatter sf)

showCoordAxes

public void showCoordAxes(java.util.Formatter sf)

showNestedTables

public void showNestedTables(java.util.Formatter sf)

getImplementationName

public java.lang.String getImplementationName()

getDetailInfo

public void getDetailInfo(java.util.Formatter sf)

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Throws:
java.io.IOException