Package ucar.nc2.ft.point.standard
Class Evaluator
- java.lang.Object
-
- ucar.nc2.ft.point.standard.Evaluator
-
public abstract class Evaluator extends Object
Helper routines for Nested Tables- Since:
- Apr 23, 2008
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Evaluator.VarAtt
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
findNameOfVariableWithAttributeValue(NetcdfDataset ds, String attName, String attValue)
Find first variable with given attribute name and valuestatic String
findNameVariableWithStandardNameAndDimension(NetcdfDataset ds, String standard_name, Dimension outer, Formatter errlog)
static Structure
findNestedStructure(Structure s)
Find first nested structurestatic Structure
findStructureWithDimensions(NetcdfDataset ds, Dimension dim0, Dimension dim1)
Find structure variable of rank 2 with the 2 given dimensions (or) Find structure variable of rank 1 with the 1 given dimensionstatic Evaluator.VarAtt
findVariableWithAttribute(NetcdfDataset ds, String attName)
Find first variable with given attribute namestatic Variable
findVariableWithAttributeAndDimension(NetcdfDataset ds, String att_name, String att_value, Dimension outer, Formatter errlog)
static Variable
findVariableWithAttributeValue(NetcdfDataset ds, String attName, String attValue)
Find first variable with given attribute name and value.static Variable
findVariableWithAttributeValue(Structure struct, String attName, String attValue)
Find first member variable in this struct with given attribute name and valuestatic Dimension
getDimension(NetcdfDataset ds, String key, Formatter errlog)
Find the dimension pointed to by keystatic String
getDimensionName(NetcdfDataset ds, String key, Formatter errlog)
Find the dimension pointed to by keystatic FeatureType
getFeatureType(NetcdfDataset ds, String key, Formatter errlog)
Turn the key into a String and return the corresponding featureType, if any.static String
getLiteral(NetcdfDataset ds, String key, Formatter errlog)
Translate key to valuestatic String
getVariableName(NetcdfDataset ds, String key, Formatter errlog)
Find the variable pointed to by keystatic boolean
hasNetcdf3RecordStructure(NetcdfDataset ds)
Does this dataset have a record structure? netcdf-3 specificstatic boolean
isEffectivelyScaler(Variable v)
-
-
-
Method Detail
-
findNameVariableWithStandardNameAndDimension
public static String findNameVariableWithStandardNameAndDimension(NetcdfDataset ds, String standard_name, Dimension outer, Formatter errlog)
-
findVariableWithAttributeAndDimension
public static Variable findVariableWithAttributeAndDimension(NetcdfDataset ds, String att_name, String att_value, Dimension outer, Formatter errlog)
-
isEffectivelyScaler
public static boolean isEffectivelyScaler(Variable v)
-
findVariableWithAttribute
public static Evaluator.VarAtt findVariableWithAttribute(NetcdfDataset ds, String attName)
Find first variable with given attribute name- Parameters:
ds
- in this datasetattName
- attribute name, case insensitive- Returns:
- first variable with given attribute name, or null
-
findVariableWithAttributeValue
public static Variable findVariableWithAttributeValue(NetcdfDataset ds, String attName, String attValue)
Find first variable with given attribute name and value. If not found, search one level into structures.- Parameters:
ds
- in this datasetattName
- attribute name, case insensitiveattValue
- attribute value, case sensitive- Returns:
- first variable with given attribute name and value, or null
-
findNameOfVariableWithAttributeValue
public static String findNameOfVariableWithAttributeValue(NetcdfDataset ds, String attName, String attValue)
Find first variable with given attribute name and value- Parameters:
ds
- in this datasetattName
- attribute name, case insensitiveattValue
- attribute value, case sensitive- Returns:
- name of first variable with given attribute name and value, or null
-
findVariableWithAttributeValue
public static Variable findVariableWithAttributeValue(Structure struct, String attName, String attValue)
Find first member variable in this struct with given attribute name and value- Parameters:
struct
- in this structureattName
- attribute name, case insensitiveattValue
- attribute value, case sensitive- Returns:
- first member variable with given attribute name and value, or null
-
findStructureWithDimensions
public static Structure findStructureWithDimensions(NetcdfDataset ds, Dimension dim0, Dimension dim1)
Find structure variable of rank 2 with the 2 given dimensions (or) Find structure variable of rank 1 with the 1 given dimension- Parameters:
ds
- in this datasetdim0
- first dimensiondim1
- second dimension (ok to be null)- Returns:
- structure variable or null
-
findNestedStructure
public static Structure findNestedStructure(Structure s)
Find first nested structure- Parameters:
s
- in this structure- Returns:
- first nested structure or null
-
hasNetcdf3RecordStructure
public static boolean hasNetcdf3RecordStructure(NetcdfDataset ds)
Does this dataset have a record structure? netcdf-3 specific- Parameters:
ds
- in this dataset- Returns:
- true if record structure exists
-
getLiteral
public static String getLiteral(NetcdfDataset ds, String key, Formatter errlog)
Translate key to value- Parameters:
ds
- search in this datasetkey
- if starts with ":", search for global attributeerrlog
- error messages here- Returns:
- return global attribute value or the key itself
-
getFeatureType
public static FeatureType getFeatureType(NetcdfDataset ds, String key, Formatter errlog)
Turn the key into a String and return the corresponding featureType, if any.- Parameters:
ds
- look in this datsetkey
- if starts with ":", replace with value of global attributeerrlog
- error messages here- Returns:
- featureType, or null
-
getVariableName
public static String getVariableName(NetcdfDataset ds, String key, Formatter errlog)
Find the variable pointed to by key- Parameters:
ds
- in this datasetkey
- may be variable name or ":gatt" where gatt is local attribute whose value is the variable nameerrlog
- error messages here- Returns:
- name of variable or null if not exist
-
getDimension
public static Dimension getDimension(NetcdfDataset ds, String key, Formatter errlog)
Find the dimension pointed to by key- Parameters:
ds
- in this datasetkey
- may be dimension name or ":gatt" where gatt is local attribute whose value is the dimension nameerrlog
- error messages here- Returns:
- dimension or null if not exist
-
getDimensionName
public static String getDimensionName(NetcdfDataset ds, String key, Formatter errlog)
Find the dimension pointed to by key- Parameters:
ds
- in this datasetkey
- may be dimension name or ":gatt" where gatt is local attribute whose value is the dimension nameerrlog
- error messages here- Returns:
- name of dimension or null if not exist
-
-