Interface Styles

  • All Known Implementing Classes:
    StylesTable

    public interface Styles
    • Method Detail

      • getNumberFormatAt

        java.lang.String getNumberFormatAt​(short fmtId)
        Get number format string given its id
        Parameters:
        fmtId - number format id
        Returns:
        number format code
      • putNumberFormat

        int putNumberFormat​(java.lang.String fmt)
        Puts fmt in the numberFormats map if the format is not already in the the number format style table. Does nothing if fmt is already in number format style table.
        Parameters:
        fmt - the number format to add to number format style table
        Returns:
        the index of fmt in the number format style table
        Throws:
        java.lang.IllegalStateException - if adding the number format to the styles table would exceed the max allowed.
      • putNumberFormat

        void putNumberFormat​(short index,
                             java.lang.String fmt)
        Add a number format with a specific ID into the numberFormats map. If a format with the same ID already exists, overwrite the format code with fmt This may be used to override built-in number formats.
        Parameters:
        index - the number format ID
        fmt - the number format code
      • removeNumberFormat

        boolean removeNumberFormat​(short index)
        Remove a number format from the style table if it exists. All cell styles with this number format will be modified to use the default number format.
        Parameters:
        index - the number format id to remove
        Returns:
        true if the number format was removed
      • removeNumberFormat

        boolean removeNumberFormat​(java.lang.String fmt)
        Remove a number format from the style table if it exists All cell styles with this number format will be modified to use the default number format
        Parameters:
        fmt - the number format to remove
        Returns:
        true if the number format was removed
      • getFontAt

        XSSFFont getFontAt​(int idx)
      • putFont

        int putFont​(XSSFFont font,
                    boolean forceRegistration)
        Records the given font in the font table. Will re-use an existing font index if this font matches another, EXCEPT if forced registration is requested. This allows people to create several fonts then customise them later. Note - End Users probably want to call XSSFFont.registerTo(StylesTable)
      • putFont

        int putFont​(XSSFFont font)
        Records the given font in the font table. Will re-use an existing font index if this font matches another.
      • getStyleAt

        XSSFCellStyle getStyleAt​(int idx)
        Parameters:
        idx - style index
        Returns:
        XSSFCellStyle or null if idx is out of bounds for xfs array
      • putBorder

        int putBorder​(XSSFCellBorder border)
        Adds a border to the border style table if it isn't already in the style table Does nothing if border is already in borders style table
        Parameters:
        border - border to add
        Returns:
        the index of the added border
      • putFill

        int putFill​(XSSFCellFill fill)
        Adds a fill to the fill style table if it isn't already in the style table Does nothing if fill is already in fill style table
        Parameters:
        fill - fill to add
        Returns:
        the index of the added fill
      • getNumCellStyles

        int getNumCellStyles()
      • getNumDataFormats

        int getNumDataFormats()