Package io.jawk.jrt
Class StrNum
java.lang.Object
io.jawk.jrt.StrNum
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:
truewhen the text is a valid AWK number
-
doubleValue
public double doubleValue()Returns this scalar's numeric value.- Returns:
- the parsed numeric value
-
toString
-