public class CellStyleCache
extends java.lang.Object
A CellStyleCache
is used internally to keep track of
CellStyles
. It defines and uses a string format for declaring
all possible style values that can be defined in a CellStyle
,
even Font
characteristics. Its lifetime is meant to last only
during a single transformation. When created, it reads in all pre-existing
CellStyle
information and caches it for later reference.
Constructor | Description |
---|---|
CellStyleCache(org.apache.poi.ss.usermodel.Workbook workbook) |
Constructs a
CellStyleCache on a Workbook . |
Modifier and Type | Method | Description |
---|---|---|
void |
cacheCellStyle(org.apache.poi.ss.usermodel.CellStyle cs) |
Caches the given
CellStyle . |
org.apache.poi.ss.usermodel.CellStyle |
findCellStyleWithFont(org.apache.poi.ss.usermodel.CellStyle cs,
org.apache.poi.ss.usermodel.Font f) |
Finds the given
CellStyle , but with the font characteristics
of the given Font , not its own Font . |
int |
getNumEntries() |
Returns the number of entries in this cache.
|
org.apache.poi.ss.usermodel.CellStyle |
retrieveCellStyle(short fontBoldweight,
boolean fontItalic,
org.apache.poi.ss.usermodel.Color fontColor,
java.lang.String fontName,
short fontHeightInPoints,
short alignment,
short borderBottom,
short borderLeft,
short borderRight,
short borderTop,
java.lang.String dataFormat,
byte fontUnderline,
boolean fontStrikeout,
boolean wrapText,
org.apache.poi.ss.usermodel.Color fillBackgroundColor,
org.apache.poi.ss.usermodel.Color fillForegroundColor,
short fillPattern,
short verticalAlignment,
short indention,
short rotation,
org.apache.poi.ss.usermodel.Color bottomBorderColor,
org.apache.poi.ss.usermodel.Color leftBorderColor,
org.apache.poi.ss.usermodel.Color rightBorderColor,
org.apache.poi.ss.usermodel.Color topBorderColor,
int fontCharset,
short fontTypeOffset,
boolean locked,
boolean hidden) |
Retrieve a
CellStyle from the cache with the given
properties. |
public CellStyleCache(org.apache.poi.ss.usermodel.Workbook workbook)
CellStyleCache
on a Workbook
.
Caches all CellStyles
found within.workbook
- A Workbook
.public int getNumEntries()
public org.apache.poi.ss.usermodel.CellStyle retrieveCellStyle(short fontBoldweight, boolean fontItalic, org.apache.poi.ss.usermodel.Color fontColor, java.lang.String fontName, short fontHeightInPoints, short alignment, short borderBottom, short borderLeft, short borderRight, short borderTop, java.lang.String dataFormat, byte fontUnderline, boolean fontStrikeout, boolean wrapText, org.apache.poi.ss.usermodel.Color fillBackgroundColor, org.apache.poi.ss.usermodel.Color fillForegroundColor, short fillPattern, short verticalAlignment, short indention, short rotation, org.apache.poi.ss.usermodel.Color bottomBorderColor, org.apache.poi.ss.usermodel.Color leftBorderColor, org.apache.poi.ss.usermodel.Color rightBorderColor, org.apache.poi.ss.usermodel.Color topBorderColor, int fontCharset, short fontTypeOffset, boolean locked, boolean hidden)
CellStyle
from the cache with the given
properties.fontBoldweight
- The font boldweight.fontItalic
- Whether the font is italic.fontColor
- The font color.fontName
- The font name.fontHeightInPoints
- The font height in points.alignment
- The horizontal alignment.borderBottom
- The bottom border type.borderLeft
- The left border type.borderRight
- The right border type.borderTop
- The top border type.dataFormat
- The data format string.fontUnderline
- The font underline.fontStrikeout
- Whether the font is in strikeout.wrapText
- Whether text is wrapped.fillBackgroundColor
- The fill background color.fillForegroundColor
- The fill foreground color.fillPattern
- The fill pattern.verticalAlignment
- The vertical alignment.indention
- How many characters the text is indented.rotation
- How many degrees the text is rotated.bottomBorderColor
- The bottom border color.leftBorderColor
- The left border color.rightBorderColor
- The right border color.topBorderColor
- The top border color.fontCharset
- The font charset.fontTypeOffset
- The font type offset.locked
- Whether the cell is "locked".hidden
- Whether the cell is "hidden".CellStyle
that matches all given properties, or
null
if it doesn't exist.public void cacheCellStyle(org.apache.poi.ss.usermodel.CellStyle cs)
CellStyle
.cs
- A CellStyle
.public org.apache.poi.ss.usermodel.CellStyle findCellStyleWithFont(org.apache.poi.ss.usermodel.CellStyle cs, org.apache.poi.ss.usermodel.Font f)
CellStyle
, but with the font characteristics
of the given Font
, not its own Font
.cs
- The CellStyle
. Cell style characteristics are
used, but the font characteristics are not used.f
- The Font
. These font characteristics are used
instead of the font characteristics on the CellStyle
.CellStyle
with the cell style characteristics of
cs
and the font characteristics of f
, if
found, else null
.Copyright © 2012–2018 Jett Team. All rights reserved.