Interface NumberNode
- All Known Implementing Classes:
BigDecimalNode,BigIntegerNode,DoubleNode,FloatNode,IntNode,LongNode
public sealed interface NumberNode
extends ValueNode
permits IntNode, LongNode, FloatNode, DoubleNode, BigIntegerNode, BigDecimalNode
NumberNode (语义标记接口)
同时移除 asXXX 上的 throws NumberFormatException (因为不可能发生)
- 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
-
asLong
-
asFloat
-
asDouble
-
asBigInteger
BigInteger asBigInteger()Description copied from interface:ValueNode转换为 BigInteger (不保证精度, 可能会发生截断)- Specified by:
asBigIntegerin interfaceValueNode- Returns:
- BigInteger
-
asBigDecimal
BigDecimal asBigDecimal()Description copied from interface:ValueNode转换为 BigDecimal- Specified by:
asBigDecimalin interfaceValueNode- Returns:
- BigDecimal
-
asText
-
asBoolean
-
deepCopy
NumberNode deepCopy()
-