本文整理了Java中org.apache.sis.util.Numbers.valueOf()
方法的一些代码示例,展示了Numbers.valueOf()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Numbers.valueOf()
方法的具体详情如下:
包路径:org.apache.sis.util.Numbers
类名称:Numbers
方法名:valueOf
[英]Converts the specified string into a value object. The value object can be an instance of BigDecimal, BigInteger, Double, Float, Long, Integer, Short, Byte, Boolean, Character or String according the specified type. This method makes the following choice:
Double#valueOf(String)(value)
;Float#valueOf(String)(value)
;Float#valueOf(String)(value)
;代码示例来源:origin: org.apache.sis.core/sis-utility
/**
* Parses the given string. Callers shall catch the {@link NumberFormatException}
* and handle the error according the caller's method contract.
*
* @throws NumberFormatException if the parsing failed.
*/
private Object valueOf(final String source) throws NumberFormatException {
return (type != Number.class) ? Numbers.valueOf(source, type) : Numbers.narrowestNumber(source);
}
代码示例来源:origin: apache/sis
/**
* Parses the given string. Callers shall catch the {@link NumberFormatException}
* and handle the error according the caller's method contract.
*
* @throws NumberFormatException if the parsing failed.
*/
private Object valueOf(final String source) throws NumberFormatException {
return (type != Number.class) ? Numbers.valueOf(source, type) : Numbers.narrowestNumber(source);
}
代码示例来源:origin: Geomatys/geotoolkit
if (token != null) {
if (Number.class.isAssignableFrom(type) || type == Boolean.class) {
token = Numbers.valueOf(token.toString(), type);
内容来源于网络,如有侵权,请联系作者删除!