Class Evaluator


  • public abstract class Evaluator
    extends Object
    Helper routines for Nested Tables
    Since:
    Apr 23, 2008
    • Method Detail

      • 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 dataset
        attName - 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 dataset
        attName - attribute name, case insensitive
        attValue - 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 dataset
        attName - attribute name, case insensitive
        attValue - 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 structure
        attName - attribute name, case insensitive
        attValue - 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 dataset
        dim0 - first dimension
        dim1 - 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 dataset
        key - if starts with ":", search for global attribute
        errlog - 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 datset
        key - if starts with ":", replace with value of global attribute
        errlog - 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 dataset
        key - may be variable name or ":gatt" where gatt is local attribute whose value is the variable name
        errlog - 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 dataset
        key - may be dimension name or ":gatt" where gatt is local attribute whose value is the dimension name
        errlog - 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 dataset
        key - may be dimension name or ":gatt" where gatt is local attribute whose value is the dimension name
        errlog - error messages here
        Returns:
        name of dimension or null if not exist