net.sf.jett.model
Class CellStyleCache

java.lang.Object
  extended by net.sf.jett.model.CellStyleCache

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.

Since:
0.5.0
Author:
Randy Gettman

Constructor Summary
CellStyleCache(org.apache.poi.ss.usermodel.Workbook workbook)
          Constructs a CellStyleCache on a Workbook.
 
Method Summary
 void cacheCellStyle(org.apache.poi.ss.usermodel.CellStyle cs)
          Caches the given CellStyle.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CellStyleCache

public CellStyleCache(org.apache.poi.ss.usermodel.Workbook workbook)
Constructs a CellStyleCache on a Workbook. Caches all CellStyles found within.

Parameters:
workbook - A Workbook.
Method Detail

getNumEntries

public int getNumEntries()
Returns the number of entries in this cache.

Returns:
The number of entries in this cache.

retrieveCellStyle

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)
Retrieve a CellStyle from the cache with the given properties.

Parameters:
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".
Returns:
A CellStyle that matches all given properties, or null if it doesn't exist.

cacheCellStyle

public void cacheCellStyle(org.apache.poi.ss.usermodel.CellStyle cs)
Caches the given CellStyle.

Parameters:
cs - A CellStyle.


Copyright © 2012-2013 Jett Team. All Rights Reserved.