Package io.jawk.jrt

Class StrNum

java.lang.Object
io.jawk.jrt.StrNum

public final class StrNum extends Object
An input-derived scalar: text that may also act as a number, following POSIX "numeric string" (strnum) semantics. Input fields, getline results, split() pieces, and similar input-originated values are represented as instances of this class so comparisons and gawk's typeof() can distinguish them from plain string constants.
  • Method Details

    • isNumber

      public boolean isNumber()
      Returns whether this scalar's text parses as an AWK number, making it a strnum.
      Returns:
      true when the text is a valid AWK number
    • doubleValue

      public double doubleValue()
      Returns this scalar's numeric value.
      Returns:
      the parsed numeric value
    • toString

      public String toString()
      Overrides:
      toString in class Object