Package io.keikai.axyra.sheets.format
Record Class ParsedValue
java.lang.Object
java.lang.Record
io.keikai.axyra.sheets.format.ParsedValue
- Record Components:
kind- the recognized input classnumber- the numeric payload (value, date serial, or 0/1 boolean)text- the textual payload (text content or formula source)
The result of classifying user-typed cell text the way Excel does, returned
by
Formats.parse(String). One record per kind of input:
ParsedValue.Kind.NUMBER—number()carries the numeric value (plain numbers, percentages, fractions, currency, scientific notation);ParsedValue.Kind.DATE—number()carries the Excel date/time serial (dates, and times as day fractions);ParsedValue.Kind.BOOL—number()is 1.0 for TRUE, 0.0 for FALSE (booleanValue()is the convenience accessor);ParsedValue.Kind.TEXT—text()is the input unchanged, except that whitespace-only input gives an empty string;ParsedValue.Kind.FORMULA—text()is the formula source with surrounding spaces removed, including the leading=.
number() is Double.NaN for TEXT/FORMULA; text()
is null for NUMBER/DATE/BOOL.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe input classes Excel distinguishes when text is typed into a cell. -
Constructor Summary
ConstructorsConstructorDescriptionParsedValue(ParsedValue.Kind kind, double number, String text) Creates an instance of aParsedValuerecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanThe boolean value:trueonly whenkind() == BOOLand the input was TRUE.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.kind()Returns the value of thekindrecord component.doublenumber()Returns the value of thenumberrecord component.text()Returns the value of thetextrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
booleanValue
public boolean booleanValue()The boolean value:trueonly whenkind() == BOOLand the input was TRUE. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
number
public double number()Returns the value of thenumberrecord component.- Returns:
- the value of the
numberrecord component
-
text
Returns the value of thetextrecord component.- Returns:
- the value of the
textrecord component
-