Interface ValueNode
- All Superinterfaces:
Node
- All Known Subinterfaces:
NumberNode
- All Known Implementing Classes:
BigDecimalNode,BigIntegerNode,BooleanNode,DoubleNode,FloatNode,IntNode,LongNode,TextNode
ValueNode
- Version:
- 0.0.1
- Author:
- scx567888
-
Method Summary
Modifier and TypeMethodDescription转换为 BigDecimal转换为 BigInteger (不保证精度, 可能会发生截断)boolean转换为 booleandoubleasDouble()转换为 double (不保证精度, 可能会发生截断)floatasFloat()转换为 float (不保证精度, 可能会发生截断)intasInt()转换为 int (不保证精度, 可能会发生截断)longasLong()转换为 long (不保证精度, 可能会发生截断)asText()转换为 StringdeepCopy()
-
Method Details
-
asInt
转换为 int (不保证精度, 可能会发生截断)- Returns:
- int
- Throws:
NumberFormatException- 数字格式不正确 (一般出现在 TextNode 中)
-
asLong
转换为 long (不保证精度, 可能会发生截断)- Returns:
- long
- Throws:
NumberFormatException- 数字格式不正确 (一般出现在 TextNode 中)
-
asFloat
转换为 float (不保证精度, 可能会发生截断)- Returns:
- float
- Throws:
NumberFormatException- 数字格式不正确 (一般出现在 TextNode 中)
-
asDouble
转换为 double (不保证精度, 可能会发生截断)- Returns:
- double
- Throws:
NumberFormatException- 数字格式不正确 (一般出现在 TextNode 中)
-
asBigInteger
转换为 BigInteger (不保证精度, 可能会发生截断)- Returns:
- BigInteger
- Throws:
NumberFormatException- 数字格式不正确 (一般出现在 TextNode 中)
-
asBigDecimal
转换为 BigDecimal- Returns:
- BigDecimal
- Throws:
NumberFormatException- 数字格式不正确 (一般出现在 TextNode 中)
-
asText
-
asBoolean
boolean asBoolean()转换为 boolean
对于 数值类型 value != 0 对于 文本类型 "true".equalsIgnoreCase(s)
- Returns:
- boolean
-
deepCopy
-