Class LongNode

java.lang.Object
cool.scx.object.node.LongNode
All Implemented Interfaces:
Node, NumberNode, ValueNode

public final class LongNode extends Object implements NumberNode
LongNode
Version:
0.0.1
Author:
scx567888
  • Constructor Details

    • LongNode

      public LongNode(long v)
  • Method Details

    • value

      public long value()
    • asInt

      public int asInt()
      Description copied from interface: ValueNode
      转换为 int (不保证精度, 可能会发生截断)
      Specified by:
      asInt in interface ValueNode
      Returns:
      int
    • asLong

      public long asLong()
      Description copied from interface: ValueNode
      转换为 long (不保证精度, 可能会发生截断)
      Specified by:
      asLong in interface ValueNode
      Returns:
      long
    • asFloat

      public float asFloat()
      Description copied from interface: ValueNode
      转换为 float (不保证精度, 可能会发生截断)
      Specified by:
      asFloat in interface ValueNode
      Returns:
      float
    • asDouble

      public double asDouble()
      Description copied from interface: ValueNode
      转换为 double (不保证精度, 可能会发生截断)
      Specified by:
      asDouble in interface ValueNode
      Returns:
      double
    • asBigInteger

      public BigInteger asBigInteger()
      Description copied from interface: ValueNode
      转换为 BigInteger (不保证精度, 可能会发生截断)
      Specified by:
      asBigInteger in interface ValueNode
      Returns:
      BigInteger
    • asBigDecimal

      public BigDecimal asBigDecimal()
      Description copied from interface: ValueNode
      转换为 BigDecimal
      Specified by:
      asBigDecimal in interface ValueNode
      Returns:
      BigDecimal
    • asText

      public String asText()
      Description copied from interface: ValueNode
      转换为 String
      Specified by:
      asText in interface ValueNode
      Returns:
      String
    • asBoolean

      public boolean asBoolean()
      Description copied from interface: ValueNode

      转换为 boolean

      对于 数值类型 value != 0 对于 文本类型 "true".equalsIgnoreCase(s)

      Specified by:
      asBoolean in interface ValueNode
      Returns:
      boolean
    • deepCopy

      public LongNode deepCopy()
      值类型不可变 返回 this 即可
      Specified by:
      deepCopy in interface Node
      Specified by:
      deepCopy in interface NumberNode
      Specified by:
      deepCopy in interface ValueNode
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object