本文整理汇总了Java中ucar.nc2.Variable.findAttribute方法的典型用法代码示例。如果您正苦于以下问题:Java Variable.findAttribute方法的具体用法?Java Variable.findAttribute怎么用?Java Variable.findAttribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ucar.nc2.Variable
的用法示例。
在下文中一共展示了Variable.findAttribute方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getAttributeStringValue
import ucar.nc2.Variable; //导入方法依赖的package包/类
/**
* Returns the trimmed String value of the attribute with the given attributeName for the given variable.
*
* @param variable
* @param attributeName
* @return String or null.
*/
private static String getAttributeStringValue(Variable variable, String attributeName) {
Attribute attribute = variable.findAttribute(attributeName);
if (attribute == null) {
return null;
}
String value = attribute.getStringValue();
if (value == null) {
return null;
}
return value.trim();
}
示例2: getMissingValueDouble
import ucar.nc2.Variable; //导入方法依赖的package包/类
/**
* @param variable
* @return value from the _FillValue (or missing_value) attribute for the given variable.
*/
public static double getMissingValueDouble(Variable variable) {
Attribute attribute = variable.findAttribute(FILL_VALUE_ATTRIBUTE_NAME);
if (attribute != null) {
return attribute.getNumericValue().doubleValue();
}
attribute = variable.findAttribute(MISSING_VALUE_ATTRIBUTE_NAME);
if (attribute != null) {
return attribute.getNumericValue().doubleValue();
}
return Double.NaN;
}
示例3: getScaleFactorDouble
import ucar.nc2.Variable; //导入方法依赖的package包/类
/**
* @param variable
* @return value from the scale_factor attribute for the given variable.
*/
public static double getScaleFactorDouble(Variable variable) {
Attribute attribute = variable.findAttribute(SCALE_FACTOR_ATTRIBUTE_NAME);
if (attribute != null) {
return attribute.getNumericValue().doubleValue();
}
return 1;
}
示例4: getOffSetDouble
import ucar.nc2.Variable; //导入方法依赖的package包/类
/**
* @param variable
* @return value from the add_offset attribute for the given variable.
*/
public static double getOffSetDouble(Variable variable) {
Attribute attribute = variable.findAttribute(ADD_OFFSET_ATTRIBUTE_NAME);
if (attribute != null) {
return attribute.getNumericValue().doubleValue();
} else {
return 0;
}
}
示例5: isLongitudeVar
import ucar.nc2.Variable; //导入方法依赖的package包/类
private boolean isLongitudeVar(Variable v) {
ucar.nc2.Attribute sn = v.findAttribute("standard_name");
return sn != null && sn.getStringValue().equalsIgnoreCase("longitude");
}