Package io.jawk.jrt
Class StrNum
java.lang.Object
io.jawk.jrt.StrNum
- All Implemented Interfaces:
Serializable
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.
Instances are serializable so they can be retained in persistent memory.
- See Also:
-
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
-