Class StreamStyle

java.lang.Object
io.keikai.axyra.sheets.io.StreamStyle

public final class StreamStyle extends Object
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 Details

    • defaults

      public static StreamStyle defaults()
      The neutral style: General number format, not bold, not italic.
    • withNumberFormat

      public StreamStyle withNumberFormat(String code)
      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 — see StreamRow.setDate(int, java.time.LocalDate, int). Pass null for General.
    • withBold

      public StreamStyle withBold()
      A copy of this style that is bold; the usual header row.
    • withBold

      public StreamStyle withBold(boolean value)
      A copy of this style with bold set to value.
    • withItalic

      public StreamStyle withItalic()
      A copy of this style that is italic.
    • withItalic

      public StreamStyle withItalic(boolean value)
      A copy of this style with italic set to value.
    • numberFormat

      public String numberFormat()
      The Excel number-format code, or null for General.
    • bold

      public boolean bold()
      Whether the font is bold.
    • italic

      public boolean italic()
      Whether the font is italic.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object