Package io.keikai.axyra.sheets.io
Class StreamStyle
java.lang.Object
io.keikai.axyra.sheets.io.StreamStyle
An immutable cell style for
StreamWorkbook: the small subset that
covers report authoring, a number format plus bold and italic. Register it
with StreamWorkbook.addStyle(io.keikai.axyra.sheets.io.StreamStyle) and pass the returned index to the
StreamRow setters.
Deliberately narrower than CellStyle.
The full style model resolves against a workbook's style table, which a
streaming writer does not have; everything here can be decided the moment a
cell is written.
Start from defaults() and derive with the with… methods,
which return new instances. Instances are value-comparable, so registering
the same style repeatedly costs one entry in the file.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanbold()Whether the font is bold.static StreamStyledefaults()The neutral style: General number format, not bold, not italic.booleaninthashCode()booleanitalic()Whether the font is italic.The Excel number-format code, ornullfor General.toString()withBold()A copy of this style that is bold; the usual header row.withBold(boolean value) A copy of this style with bold set tovalue.A copy of this style that is italic.withItalic(boolean value) A copy of this style with italic set tovalue.withNumberFormat(String code) A copy of this style with an Excel number format code, e.g.
-
Method Details
-
defaults
The neutral style: General number format, not bold, not italic. -
withNumberFormat
A copy of this style with an Excel number format code, e.g."#,##0.00"or"yyyy-mm-dd". Excel has no date type: a date cell is a serial number plus a date format — seeStreamRow.setDate(int, java.time.LocalDate, int). Passnullfor General. -
withBold
A copy of this style that is bold; the usual header row. -
withBold
A copy of this style with bold set tovalue. -
withItalic
A copy of this style that is italic. -
withItalic
A copy of this style with italic set tovalue. -
numberFormat
The Excel number-format code, ornullfor General. -
bold
public boolean bold()Whether the font is bold. -
italic
public boolean italic()Whether the font is italic. -
equals
-
hashCode
public int hashCode() -
toString
-