Direct Known Subclasses:
DoubleValue, IntValue

public abstract class NumberValue extends PrimitiveValue
  • Field Details

  • Constructor Details

    • NumberValue

      public NumberValue()
  • Method Details

    • type

      public final StringValue type()
      Specified by:
      type in class Value
    • getDouble

      public abstract double getDouble()
    • getInt

      public abstract int getInt()
    • getLong

      public abstract long getLong()
    • isLong

      public abstract boolean isLong()
    • isInt

      public abstract boolean isInt()
    • equals

      public abstract boolean equals(Object other)
      Overrides:
      equals in class Object
    • toString

      public abstract String toString()
      Overrides:
      toString in class Object
    • toBoolean

      public final boolean toBoolean()
      Specified by:
      toBoolean in class Value
    • toNumber

      public final NumberValue toNumber(me.topchetoeu.j2s.common.Environment ext)
      Specified by:
      toNumber in class Value
    • toString

      public final String toString(me.topchetoeu.j2s.common.Environment ext)
      Specified by:
      toString in class Value
    • getPrototype

      public final ObjectValue getPrototype(me.topchetoeu.j2s.common.Environment env)
      Specified by:
      getPrototype in class Value
    • of

      public static NumberValue of(double value)
    • of

      public static NumberValue of(long value)
    • of

      public static NumberValue of(int value)