com.extentech.ExtenXLS
Class CellHandle

java.lang.Object
  extended by com.extentech.ExtenXLS.CellHandle
All Implemented Interfaces:
Cell, Handle, com.extentech.swingtools.table.CellSpan, Serializable, Comparable

public class CellHandle
extends Object
implements Cell, com.extentech.swingtools.table.CellSpan, Serializable, Handle, Comparable

The CellHandle provides a handle to an XLS Cell and its values.
Use the CellHandle to work with individual Cells in an XLS file.
To instantiate a CellHandle, you must first have a valid WorkSheetHandle, which in turn requires a valid WorkBookHandle.

for example:

WorkBookHandle book = newWorkBookHandle("testxls.xls");
WorkSheetHandle sheet1 = book.getWorkSheet("Sheet1");
CellHandlecell = sheet1.getCell("B22");


With a CellHandle you can:

- get the value of a Cell
- set the value of a Cell
- change the color, font, and background formatting of a Cell
- change the formatting pattern of a Cell
- change the value of a Cell
- get a handle to any Formula for this Cell

Since:
1.3
Version:
4.1
Author:
John McMahon -- Copyright ©2011Extentech Inc.
See Also:
WorkBookHandle, WorkSheetHandle, FormulaHandle, CellNotFoundException, CellTypeMismatchException, Serialized Form

Field Summary
 int COLUMN
           
static int NOTATION_SCIENTIFIC
           
static int NOTATION_SCIENTIFIC_EXCEL
           
static int NOTATION_STANDARD
           
 int ROW
           
static int TYPE_BLANK
          Cell types
static int TYPE_BOOLEAN
           
static int TYPE_DOUBLE
           
static int TYPE_FORMULA
           
static int TYPE_FP
           
static int TYPE_INT
           
static int TYPE_STRING
           
 
Constructor Summary
CellHandle(com.extentech.formats.XLS.BiffRec c)
          Public Constructor added for use in Bean-context ONLY.
CellHandle(com.extentech.formats.XLS.BiffRec c, WorkBook myb)
          Public Constructor added for use in Bean-context ONLY.
 
Method Summary
 void addConditionalFormat(ConditionalFormatHandle format)
          Set a conditional format upon this cell.
 List calculateAffectedCells()
          Calculates and returns all formulas that reference this CellHandle.
 List calculateAffectedCellsOnSheet()
          Calculates and returns all formulas on the same sheet that reference this CellHandle.
 void clear()
          Resets this cell to the default, as if it had just been added.
 void clearContents()
          Resets this cells contents to blank.
 void clearFormats()
          Resets this cell's format to the default.
 void combine(int[] x, int[] y)
          unimplemented - do not use
 int compareTo(Object ob)
          compare this Cell (via it's string value i.e.
static CellHandle copyCellToWorkSheet(CellHandle sourcecell, WorkSheetHandle newsheet)
          Create a copy of this Cell in another WorkBook
static CellHandle copyCellToWorkSheet(CellHandle sourcecell, WorkSheetHandle newsheet, int row, int col)
          Creates a copy of this cell on the given worksheet at the given address.
static CellHandle copyCellToWorkSheet(CellHandle sourcecell, WorkSheetHandle newsheet, int row, int col, boolean copyByValue)
          Creates a copy of this cell on the given worksheet at the given address.
 void copyFormat(CellHandle source)
          Copy all formats from a source Cell to this Cell
 CellHandle copyTo(String newaddr)
          copy this Cell to another location.
 CommentHandle createComment(String comment, String author)
          Creates a new annotation (Note or Comment) to the cell
 boolean equals(Object ob)
          compare this Cells equality (via it's string value i.e.
 void fireParserEvent()
          this method will be fired as each record is parsed from an input Spreadsheet Dec 15, 2010
 Font getAwtFont()
          convert the ExtenXLS font used by this Cell to java.awt.Font
 Color getBackgroundColor()
          get the Color of the Cell Background by this Cell and all other cells sharing this FormatId.
 int getBackgroundPattern()
          get the Background Pattern for this cell
 boolean getBooleanVal()
          returns the value of this Cell as a boolean
If the Cell is not of type Boolean, returns false
 Color[] getBorderColors()
          returns Border Colors of Cell in: top, left, bottom, right order
returns null or a java.awt.Color object for each of 4 sides
 byte[] getBytes()
          returns the low-level bytes for the underlying BIFF8 record.
 com.extentech.formats.XLS.BiffRec getCell()
          return the underlying cell record
for internal API use only
 String getCellAddress()
          Returns the Address of this Cell as a String.
 Color getCellBackgroundColor()
          Return the cell background color i.e.
 int getCellRotation()
          Get the rotation of this Cell in degrees.
 int getCellType()
          Returns the type of the Cell as an int
TYPE_STRING = 0, TYPE_FP = 1, TYPE_INT = 2, TYPE_FORMULA = 3, TYPE_BOOLEAN = 4, TYPE_DOUBLE = 5;
 String getCellTypeName()
          returns the java Type string of the Cell
One of: "String" "Float" "Integer" "Formula" "Double"
 ColHandle getCol()
          Returns the ColHandle for the Cell.
 int getColNum()
          Returns the column number of this Cell.
 CommentHandle getComment()
          Get a CommentHandle to the note attached to this cell
 ConditionalFormatHandle[] getConditionalFormatHandles()
          return all the ConditionalFormatHandles for this Cell, if any
 int getConditionalFormatId()
          get the conditional formatting record ID (FormatId)
returns the normal FormatId if the condition(s) in the conditional format have not been met
 FormatHandle[] getConditionallyFormattedHandles()
          returns an array of FormatHandles for the Cell that have the current conditional format applied to them.
 Object getDefaultVal()
          Get the default "empty" data value for this CellHandle
 double getDoubleVal()
          returns the value of this Cell as a double, if possible, or NaN if Cell value cannot be converted to double
 int getFillPattern()
          get the fill pattern for this cell
Same as getBackgroundPattern
 float getFloatVal()
          returns the value of this Cell as a float, if possible, or NaN if Cell value cannot be converted to float
 com.extentech.formats.XLS.Font getFont()
          Get the ExtenXLS Font for this Cell, which roughly matches the functionality of the java.awt.Font class.
 Color getFontColor()
          get the Color of the Font used by this Cell.
 String getFontFace()
          get the Font face used by this Cell.
 int getFontSize()
          get the size in points of the Font used by this Cell
 int getFontWeight()
          get the weight (boldness) of the Font used by this Cell.
 Color getForegroundColor()
          get the Color of the Cell Foreground of this Cell and all other cells sharing this FormatId.
 FormatHandle getFormatHandle()
          Gets the FormatHandle (a Format Object describing the formats for this Cell) for this Cell.
 int getFormatId()
          Returns the Formatting record ID (FormatId) for this Cell
This can be used with 'setFormatId(int i)' to copy the formatting from one Cell to another (e.g.
 String getFormatPattern()
          Gets the number format pattern for this cell, if set.
 String getFormattedStringVal()
          Gets the value of the cell as a String with the number format applied.
 FormulaHandle getFormulaHandle()
          Returns the Formula Handle (an Object describing a Formula) for this Cell, if it contains a formula
 int getHorizontalAlignment()
          Returns an int representing the current horizontal alignment in this Cell.
 int getIntVal()
          returns the value of this Cell as a int, if possible, or NaN if Cell value cannot be converted to int
 boolean getIsUnderlined()
          returns whether the Font for this Cell is underlined
 String getJSON()
          Get the JSON object for this cell.
 CellRange getMergedCellRange()
          Returns any other Cells merged with this one, or null if this Cell is not a part of a merged range.
 com.extentech.formats.XLS.XLSRecord getRecord()
          returns the underlying BIFF8 record for the Cell
NOTE: the underlying record is not a part of the public API and may change at any time.
 RowHandle getRow()
          Returns the RowHandle for the Cell.
 int getRowNum()
          Returns the row number of this Cell.
 int getSheetNum()
          get the index of the WorkSheet containing this Cell in the list of sheets
 int[] getSpan(int row, int column)
          returns the size of the Merged Cell area if this Cell is a part of a Merged Cell area
 String getStringVal()
          Returns the value of the Cell as a String.
 String getStringVal(int notation)
          Returns the value of the Cell as a String.
 String getStringVal(String encoding)
          Returns the value of the Cell as a String with the specified encoding.
 String getURL()
          Returns the Hyperlink URL String for this Cell, if any
 String getURLDescription()
          Returns the URL Description String for this Cell, if any
 Object getVal()
          Returns the value of this Cell in the native underlying data type.
 ValidationHandle getValidationHandle()
          Returns the validation handle for the cell.
 int getVerticalAlignment()
          Returns an int representing the current vertical alignment in this Cell.
 WorkBook getWorkBook()
          returns the WorkBookHandle for this Cell
 WorkSheetHandle getWorkSheetHandle()
          get the WorkSheetHandle for this Cell
 String getWorkSheetName()
          Returns the name of this Cell's WorkSheet as a String.
 boolean getWrapText()
          Get the cell wrapping behavior for this cell.
 String getXML()
          Returns an XML representation of the cell and it's component data
 String getXML(int[] mergedRange)
          Returns an XML representation of the cell and it's component data
 boolean hasHyperlink()
          returns true if this Cell contains a hyperlink
 boolean isBlank()
          Returns whether this is a blank cell.
 boolean isCurrency()
          Returns whether this Cell has a Currency format applied.
 boolean isDate()
          Returns whether this Cell has Date formatting applied.
 boolean isDefaultCell()
          Determines if the cellHandle represents a completely blank/null cell, and can thus be ignored for many operations.
 boolean isFormula()
          Returns whether this cell is a formula.
 boolean isFormulaHidden()
          Returns whether the formula for the Cell is hidden
 boolean isLocked()
          returns whether this Cell is locked for editing
 boolean isMergeParent()
          Returns if the Cell is the parent (cell containing display value) of a merged cell range.
 boolean isNumber()
          Returns whether this Cell has a numeric value
 boolean isVisible(int row, int column)
          returns whether this Cell is visible in UI implementations.
 void moveTo(String newaddr)
          move this cell to another location.
 void moveToCol(String newcol)
          move this cell to another column
throws CellPositionConflictException if there is a cell in that position already
 void moveToRow(int newrow)
          move this cell to another row
throws CellPositionConflictException if there is a cell in that position already
 void remove(boolean nullme)
          Removes this Cell from the WorkSheet
 void removeComment()
          Removes any note/comment records attached to this cell
 void setBackgroundColor(Color col)
          set the Color of the Cell Background pattern for this Cell.
 void setBackgroundColor(int t)
          set the Background Color for this Cell.
 void setBackgroundPattern(int t)
          set the Background Pattern for this Cell.
 void setBold(boolean bold)
          Convenience method for toggling the bold state of the Font used by this Cell.
 void setBorderBottomColor(Color col)
          set the Color of the bottom Border line for this Cell.
 void setBorderColor(Color col)
          set the Color of the Border for this Cell.
 void setBorderLeftColor(Color col)
          set the Color of the left Border line for this Cell.
 void setBorderLineStyle(short s)
          set the Border line style for this Cell.
 void setBorderRightColor(Color col)
          set the Color of the right Border line for this Cell.
 void setBorderTopColor(Color col)
          set the Color of the top Border line for this Cell.
 void setBottomBorderLineStyle(short s)
          set the Bottom Border line style for this Cell.
 void setCellBackgroundColor(Color col)
          set the Color of the Cell Background for this Cell.
 void setCellBackgroundColor(int t)
          set the Color of the Cell Background for this Cell.
 void setCellRotation(int align)
          Set the rotation of the cell in degrees.
 void setFileURL(String fileURLStr)
          Sets a hyperlink to a location within the current template
The URL String should be prefixed with "file://"
 void setFileURL(String fileURLstr, String desc, String textMark)
          Sets a hyperlink to a location within the current template, and includes additional optional information: description + textMark text

The URL String should be prefixed with "file://"

The textMark text is the porition of the URL that follows #
 void setFont(String fn, int stl, int sz)
          Set the Font for this Cell via font name, font style and font size
This method adds a new Font to the WorkBook.
 void setFontColor(Color col)
          Set the color of the Font used by this Cell.
 void setFontColor(int t)
          set the Font Color for this Cell

see FormatHandle.COLOR constants for valid values
 void setFontFace(String fn)
          set the Font face used by this Cell.
 void setFontSize(int sz)
          change the size (in points) of the Font used by this Cell and all other Cells sharing this FormatId.
 void setFontWeight(int wt)
          change the weight (boldness) of the Font used by this Cell.
 void setForeColor(int i)
          set the Foreground Color for this Cell
NOTE: this is the PATTERN Color
 void setForegroundColor(Color col)
          sets the Color of the Cell Foreground pattern for this Cell.
 void setForegroundColor(int t)
          set the Foreground Color for this Cell.
 void setFormatHandle(FormatHandle f)
          Sets the FormatHandle (a Format Object describing the formats for this Cell) for this Cell
 void setFormatId(int i)
          Sets the Formatting record ID (FormatId) for this Cell This can be used with 'getFormatId()' to copy the formatting from one Cell to another (ie: a template cell to a new cell)
 void setFormatPattern(String pat)
          Sets the number format pattern for this cell.
 void setFormula(Stack newExp, Object value)
          sets the formula for this cellhandle using a stack of Ptgs appropriate for formula records.
 void setFormula(String formStr)
          Set a cell to Excel-compatible formula passed in as String.
 void setFormula(String formStr, Object value)
          Set a cell to formula passed in as String.
 void setFormulaHidden(boolean hidden)
          Hides or shows the formula for this Cell, if present
 void setHorizontalAlignment(int align)
          Set the horizontal alignment for this Cell
 void setLeftBorderLineStyle(short s)
          set the Left Border line style for this Cell.
 void setLocked(boolean locked)
          locks or unlocks this Cell for editing
 void setPatternBackgroundColor(Color col)
          set the Color of the Cell Background Pattern for this Cell.
 void setRecord(com.extentech.formats.XLS.XLSRecord rec)
          sets the underlying BIFF8 record for the Cell
NOTE: the underlying record is not a part of the public API and may change at any time.
 void setRightBorderLineStyle(short s)
          set the Right Border line style for this Cell.
 void setScript(int ss)
          Set the super/sub script for the Font
 void setSpan(int[] span, int row, int column)
          internal UI interface implementation -- do not use
 void setStringVal(String s)
          set the value of this cell to String s
NOTE: this method will not check for formula references or do any data conversions
This method is useful when a string may start with = but you do not want to convert to a Formula value If you wish to put a line break in the string use the newline "\n" character.
 void setStringVal(com.extentech.formats.XLS.Unicodestring us)
          set the value of this cell to Unicodestring us
NOTE: This method will not check for formula references or do any data conversions
Useful when strings may start with = but you do not want to convert to a formula value
 void setToDefault()
          Sets a default "empty" value appropriate for the cell type of this CellHandle
For example, will set the value to 0.0 for TYPE_DOUBLE, an empty String for TYPE_BLANK
 void setTopBorderLineStyle(short s)
          set the Top Border line style for this Cell.
 void setUnderlined(boolean isUnderlined)
          Set whether the Font for this Cell is underlined
 void setURL(String urlstr)
          Creates a new Hyperlink for this Cell from a URL String.
 void setURL(String urlstr, String desc, String textMark)
          Creates a new Hyperlink for this Cell from a URL String, a descrpiton and textMark text.
 void setVal(boolean b)
          Sets the value of this Cell to a boolean value
 void setVal(Date dt, String fmt)
          Sets the value of this Cell to a java.sql.Date.
 void setVal(double d)
          Set the Value of the Cell to a double
 void setVal(float f)
          Set value of this Cell to a Float
 void setVal(int i)
          Set the value of this Cell to an int value
NOTE: setting a Boolean Cell type to a zero or a negative number will set the Cell to 'false'; setting it to an int value 1 or greater will set it to true.
 void setVal(Object obj)
          Set the val of this Cell to an object

The object may be one of type:
String, Float, Integer, Double, Long, Boolean, java.sql.Date, or null

To set a Cell to a formula, obj should be a string begining with "="

To set a Cell to an array formula, obj should be a string begining with "{="
If you wish to put a line break in a string value, use the newline "\n" character.
 void setVerticalAlignment(int align)
          Set the Vertical alignment for this Cell
 void setWorkSheetHandle(WorkSheetHandle handle)
          set the WorkSheetHandle for this Cell
 void setWrapText(boolean wrapit)
          Sets the cell wrapping behavior for this cell
 void split(int row, int column)
          internal UI interface implementation -- do not use
 String toString()
          Returns a String representation of this CellHandle
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_BLANK

public static final int TYPE_BLANK
Cell types

See Also:
Constant Field Values

TYPE_STRING

public static final int TYPE_STRING
See Also:
Constant Field Values

TYPE_FP

public static final int TYPE_FP
See Also:
Constant Field Values

TYPE_INT

public static final int TYPE_INT
See Also:
Constant Field Values

TYPE_FORMULA

public static final int TYPE_FORMULA
See Also:
Constant Field Values

TYPE_BOOLEAN

public static final int TYPE_BOOLEAN
See Also:
Constant Field Values

TYPE_DOUBLE

public static final int TYPE_DOUBLE
See Also:
Constant Field Values

NOTATION_STANDARD

public static final int NOTATION_STANDARD
See Also:
Constant Field Values

NOTATION_SCIENTIFIC

public static final int NOTATION_SCIENTIFIC
See Also:
Constant Field Values

NOTATION_SCIENTIFIC_EXCEL

public static final int NOTATION_SCIENTIFIC_EXCEL
See Also:
Constant Field Values

ROW

public final int ROW
See Also:
Constant Field Values

COLUMN

public final int COLUMN
See Also:
Constant Field Values
Constructor Detail

CellHandle

public CellHandle(com.extentech.formats.XLS.BiffRec c)
Public Constructor added for use in Bean-context ONLY. Do NOT create CellHandles manually.


CellHandle

public CellHandle(com.extentech.formats.XLS.BiffRec c,
                  WorkBook myb)
Public Constructor added for use in Bean-context ONLY. Do NOT create CellHandles manually.

Method Detail

getRecord

public com.extentech.formats.XLS.XLSRecord getRecord()
returns the underlying BIFF8 record for the Cell
NOTE: the underlying record is not a part of the public API and may change at any time.

Returns:
Returns the underlying biff record.

setRecord

public void setRecord(com.extentech.formats.XLS.XLSRecord rec)
sets the underlying BIFF8 record for the Cell
NOTE: the underlying record is not a part of the public API and may change at any time.

Parameters:
XLSRecord - rec - The BIFF record to set.

setToDefault

public void setToDefault()
Sets a default "empty" value appropriate for the cell type of this CellHandle
For example, will set the value to 0.0 for TYPE_DOUBLE, an empty String for TYPE_BLANK


getDefaultVal

public Object getDefaultVal()
Get the default "empty" data value for this CellHandle

Returns:
Object a default empty value corresponding to the cell type
such as 0.0 for TYPE_DOUBLE or an empty String for TYPE_BLANK

setFormatPattern

public void setFormatPattern(String pat)
Sets the number format pattern for this cell. All Excel built-in number formats are supported. Custom formats will not be applied by ExtenXLS (e.g. the getFormattedStringVal() method) but they will be written correctly to the output file. For more information on number format patterns see Microsoft KB264372.

Parameters:
pat - the Excel number format pattern to apply
See Also:
FormatConstantsImpl.getBuiltinFormats()

getFormatPattern

public String getFormatPattern()
Gets the number format pattern for this cell, if set. For more information on number format patterns see Microsoft KB264372.

Returns:
the Excel number format pattern for this cell or null if none is applied

isDate

public boolean isDate()
Returns whether this Cell has Date formatting applied.
NOTE: This does not guarantee that the value is a valid date.

Specified by:
isDate in interface Cell
Returns:
boolean true if this Cell has a Date Format applied

isFormula

public boolean isFormula()
Returns whether this cell is a formula.


isFormulaHidden

public boolean isFormulaHidden()
Returns whether the formula for the Cell is hidden

Returns:
boolean true if formula is hidden

isLocked

public boolean isLocked()
returns whether this Cell is locked for editing

Returns:
boolean true if the cell is locked

isBlank

public boolean isBlank()
Returns whether this is a blank cell.

Returns:
true if this cell is blank

isCurrency

public boolean isCurrency()
Returns whether this Cell has a Currency format applied.

Returns:
boolean true if this Cell has a Currency format applied

isNumber

public boolean isNumber()
Returns whether this Cell has a numeric value

Returns:
boolean true if this Cell contains a numeric value

setFontSize

public void setFontSize(int sz)
change the size (in points) of the Font used by this Cell and all other Cells sharing this FormatId.
NOTE: To add an entirely new Font use the setFont(String fn, int typ, int sz) method instead.

Parameters:
int - sz - Font size in Points.

setFontWeight

public void setFontWeight(int wt)
change the weight (boldness) of the Font used by this Cell.
Some examples:
a weight of 200 is normal
a weight of 700 is bold

Parameters:
int - wt - Font weight range between 100-1000

setBold

public void setBold(boolean bold)
Convenience method for toggling the bold state of the Font used by this Cell.

Parameters:
boolean - bold - true if bold

getFontWeight

public int getFontWeight()
get the weight (boldness) of the Font used by this Cell.

Returns:
int Font weight range between 100-1000

getFontSize

public int getFontSize()
get the size in points of the Font used by this Cell

Returns:
int Font size in Points.

getFontColor

public Color getFontColor()
get the Color of the Font used by this Cell.

Returns:
int Excel color constant for Font color
See Also:
constants

setFontColor

public void setFontColor(Color col)
Set the color of the Font used by this Cell.

Parameters:
java.Awt.Color - col - color of the font

setForegroundColor

public void setForegroundColor(int t)
set the Foreground Color for this Cell.

NOTE: Foreground color is the CELL BACKGROUND color for all patterns and Background color is the PATTERN color for all patterns not equal to PATTERN_SOLID
For PATTERN_SOLID, the Foreground color is the CELL BACKGROUND color and Background Color is 64 (white).

Parameters:
int - t - Excel color constant
See Also:
constants

setForeColor

public void setForeColor(int i)
set the Foreground Color for this Cell
NOTE: this is the PATTERN Color

Parameters:
int - Excel color constant
See Also:
constants

setBackgroundColor

public void setBackgroundColor(int t)
set the Background Color for this Cell.

NOTE: Foreground color is the CELL BACKGROUND color for all patterns and Background color is the PATTERN color for all patterns not equal to PATTERN_SOLID
For PATTERN_SOLID, the Foreground color is the CELL BACKGROUND color and Background Color is 64 (white).

Parameters:
int - t - Excel color constant
See Also:
constants

getForegroundColor

public Color getForegroundColor()
get the Color of the Cell Foreground of this Cell and all other cells sharing this FormatId.

NOTE: Foreground color is the CELL BACKGROUND color for all patterns and Background color is the PATTERN color for all patterns not equal to PATTERN_SOLID
For PATTERN_SOLID, the Foreground color is the CELL BACKGROUND color and Background Color is 64 (white).

Returns:
java.awt.Color of the Font

setForegroundColor

public void setForegroundColor(Color col)
sets the Color of the Cell Foreground pattern for this Cell.

NOTE: Foreground color is the CELL BACKGROUND color for all patterns and Background color is the PATTERN color for all patterns not equal to PATTERN_SOLID
For PATTERN_SOLID, the Foreground color is the CELL BACKGROUND color and Background Color is 64 (white).

Parameters:
java.awt.Color - col - color for the foreground

getBackgroundColor

public Color getBackgroundColor()
get the Color of the Cell Background by this Cell and all other cells sharing this FormatId.

NOTE: Foreground color is the CELL BACKGROUND color for all patterns and Background color is the PATTERN color for all patterns not equal to PATTERN_SOLID
For PATTERN_SOLID, the Foreground color is the CELL BACKGROUND color and Background Color is 64 (white).

Returns:
java.awt.Color for the Font

getCellBackgroundColor

public Color getCellBackgroundColor()
Return the cell background color i.e. the color if a pattern is set, or white if none

Returns:
java.awt.Color cell background color

setBackgroundColor

public void setBackgroundColor(Color col)
set the Color of the Cell Background pattern for this Cell.

NOTE: Foreground color is the CELL BACKGROUND color for all patterns and Background color is the PATTERN color for all patterns not equal to PATTERN_SOLID
For PATTERN_SOLID, the Foreground color is the CELL BACKGROUND color and Background Color is 64 (white).

Parameters:
java.awt.Color - col - background color

setCellBackgroundColor

public void setCellBackgroundColor(int t)
set the Color of the Cell Background for this Cell.

see FormatHandle.COLOR constants for valid values

NOTE: Foreground color is the CELL BACKGROUND color for all patterns and Background color is the PATTERN color for all patterns not equal to PATTERN_SOLID
For PATTERN_SOLID, the Foreground color is the CELL BACKGROUND color and Background Color is 64 (white).

Parameters:
int - t - Excel color constant for Cell Background color

setCellBackgroundColor

public void setCellBackgroundColor(Color col)
set the Color of the Cell Background for this Cell.

NOTE: Foreground color is the CELL BACKGROUND color for all patterns and Background color is the PATTERN color for all patterns not equal to PATTERN_SOLID
For PATTERN_SOLID, the Foreground color is the CELL BACKGROUND color and Background Color is 64 (white).

Parameters:
java.awt.Color - col - color of the cell background

setPatternBackgroundColor

public void setPatternBackgroundColor(Color col)
set the Color of the Cell Background Pattern for this Cell.

Parameters:
java.awt.Color - col - color of the pattern background

setBackgroundPattern

public void setBackgroundPattern(int t)
set the Background Pattern for this Cell.

Parameters:
int - t - Excel pattern constant
See Also:
constants

getBackgroundPattern

public int getBackgroundPattern()
get the Background Pattern for this cell

Returns:
int Excel pattern constant
See Also:
constants

getFillPattern

public int getFillPattern()
get the fill pattern for this cell
Same as getBackgroundPattern

Returns:
int Excel fill pattern constant
See Also:
constants

setBorderColor

public void setBorderColor(Color col)
set the Color of the Border for this Cell.

Parameters:
java.awt.Color - col - border color

setBorderRightColor

public void setBorderRightColor(Color col)
set the Color of the right Border line for this Cell.

Parameters:
java.awt.Color - col - right border color

setBorderLeftColor

public void setBorderLeftColor(Color col)
set the Color of the left Border line for this Cell.

Parameters:
java.awt.Color - col - left border color

setBorderTopColor

public void setBorderTopColor(Color col)
set the Color of the top Border line for this Cell.

Parameters:
java.awt.Color - col - top border color

setBorderBottomColor

public void setBorderBottomColor(Color col)
set the Color of the bottom Border line for this Cell.

Parameters:
java.awt.Color - col - bottom border color

getFontFace

public String getFontFace()
get the Font face used by this Cell.

Returns:
String the system name of the font for this Cell

setFontFace

public void setFontFace(String fn)
set the Font face used by this Cell.

Parameters:
String - fn - system name of the font

setBorderLineStyle

public void setBorderLineStyle(short s)
set the Border line style for this Cell.

Parameters:
short - s - border constant
See Also:
line style constants

setRightBorderLineStyle

public void setRightBorderLineStyle(short s)
set the Right Border line style for this Cell.

Parameters:
short - s - border constant
See Also:
line style constants

setLeftBorderLineStyle

public void setLeftBorderLineStyle(short s)
set the Left Border line style for this Cell.

Parameters:
short - s - border constant
See Also:
line style constants

setTopBorderLineStyle

public void setTopBorderLineStyle(short s)
set the Top Border line style for this Cell.

Parameters:
short - s - border constant
See Also:
line style constants

setBottomBorderLineStyle

public void setBottomBorderLineStyle(short s)
set the Bottom Border line style for this Cell.

Parameters:
short - s - border constant
See Also:
line style constants

getFont

public com.extentech.formats.XLS.Font getFont()
Get the ExtenXLS Font for this Cell, which roughly matches the functionality of the java.awt.Font class.
Due to awt problems on console systems, converting the ExtenXLS font to a GUI font is up to you.

Returns:
ExtenXLS font for Cell

getAwtFont

public Font getAwtFont()
convert the ExtenXLS font used by this Cell to java.awt.Font

Returns:
java.awt.Font for this cell

setFont

public void setFont(String fn,
                    int stl,
                    int sz)
Set the Font for this Cell via font name, font style and font size
This method adds a new Font to the WorkBook.
Roughly matches the functionality of the java.awt.Font class.

Parameters:
String - fn - system name of the font e.g. "Arial"
int - stl - font style (either Font.BOLD or Font.PLAIN)
int - sz - font size in points

getComment

public CommentHandle getComment()
                         throws DocumentObjectNotFoundException
Get a CommentHandle to the note attached to this cell

Throws:
DocumentObjectNotFoundException

removeComment

public void removeComment()
Removes any note/comment records attached to this cell


createComment

public CommentHandle createComment(String comment,
                                   String author)
Creates a new annotation (Note or Comment) to the cell

Parameters:
comment - -- text of note
author - -- name of author
Returns:
CommentHandle - handle which allows access to the Note object
See Also:
CommentHandle

getIsUnderlined

public boolean getIsUnderlined()
returns whether the Font for this Cell is underlined

Returns:
boolean true if Font is underlined

setUnderlined

public void setUnderlined(boolean isUnderlined)
Set whether the Font for this Cell is underlined

Parameters:
boolean - b - true if the Font for this Cell should be underlined (single underline only)

setFontColor

public void setFontColor(int t)
set the Font Color for this Cell

see FormatHandle.COLOR constants for valid values

Parameters:
int - t - Excel color constant

getMergedCellRange

public CellRange getMergedCellRange()
Returns any other Cells merged with this one, or null if this Cell is not a part of a merged range.
Adding and/or removing Cells from this CellRange will merge or unmerge the Cells.

Returns:
CellRange object containing all Cells in this Cell's merged range.

isMergeParent

public boolean isMergeParent()
Returns if the Cell is the parent (cell containing display value) of a merged cell range.

Returns:
boolean true if this cell is a merge parent cell

getCol

public ColHandle getCol()
Returns the ColHandle for the Cell.

Returns:
ColHandle for the Cell

getRow

public RowHandle getRow()
Returns the RowHandle for the Cell.

Returns:
RowHandle representing the Row for the Cell

getVal

public Object getVal()
Returns the value of this Cell in the native underlying data type. Formula cells will return the calculated value of the formula in the calculated data type. Use 'getStringVal()' to return a String regardless of underlying value type.

Specified by:
getVal in interface Cell
Returns:
Object value for this Cell

getCellTypeName

public String getCellTypeName()
returns the java Type string of the Cell
One of:
  • "String"
  • "Float"
  • "Integer"
  • "Formula"
  • "Double"

    Returns:
    String java data type

  • getCellType

    public int getCellType()
    Returns the type of the Cell as an int
  • TYPE_STRING = 0,
  • TYPE_FP = 1,
  • TYPE_INT = 2,
  • TYPE_FORMULA = 3,
  • TYPE_BOOLEAN = 4,
  • TYPE_DOUBLE = 5;

    Specified by:
    getCellType in interface Cell
    Returns:
    int type for this Cell

  • getCell

    public com.extentech.formats.XLS.BiffRec getCell()
    return the underlying cell record
    for internal API use only

    Returns:
    XLS cell record

    getBorderColors

    public Color[] getBorderColors()
    returns Border Colors of Cell in: top, left, bottom, right order
    returns null or a java.awt.Color object for each of 4 sides

    Returns:
    java.awt.Color array representing the 4 borders of the cell

    getBytes

    public byte[] getBytes()
    returns the low-level bytes for the underlying BIFF8 record.
    For Internal API use only

    Returns:
    bytes for the underlying record

    getColNum

    public int getColNum()
    Returns the column number of this Cell.

    Specified by:
    getColNum in interface Cell
    Returns:
    int the Column Number of the Cell

    getRowNum

    public int getRowNum()
    Returns the row number of this Cell. NOTE: This is the 1-based row number such as you will see in a spreadsheet UI. ie: A1 = row 1

    Specified by:
    getRowNum in interface Cell
    Returns:
    1-based int the Row Number of the Cell

    getCellAddress

    public String getCellAddress()
    Returns the Address of this Cell as a String.

    Specified by:
    getCellAddress in interface Cell
    Returns:
    String the address of this Cell in the WorkSheet

    getWorkSheetName

    public String getWorkSheetName()
    Returns the name of this Cell's WorkSheet as a String.

    Specified by:
    getWorkSheetName in interface Cell
    Returns:
    String the name this Cell's WorkSheet

    getStringVal

    public String getStringVal()
    Returns the value of the Cell as a String.
    boolean Cell types will return "true" or "false"

    Returns:
    String the value of the Cell

    getFormattedStringVal

    public String getFormattedStringVal()
    Gets the value of the cell as a String with the number format applied. Boolean cell types will return "true" or "false". Custom number formats are not currently supported, although they will be written correctly to the output file. Patterns that display negative numbers in red are not currently supported; the number will be prefixed with a minus sign instead. For more information on number format patterns see Microsoft KB264372.

    Specified by:
    getFormattedStringVal in interface Cell
    Returns:
    the value of the cell as a string formatted according to the cell type and, if present, the number format pattern

    getStringVal

    public String getStringVal(int notation)
    Returns the value of the Cell as a String.
    For numeric cell values, including cells containing a formula which return a numeric value, the notation to be used in representing the value as a String must be specified.
    The Notation choices are:
  • CellHandle.NOTATION_STANDARD e.g. "8002974342"
  • CellHandle.NOTATION_SCIENTIFIC e.g. "8.002974342E9"
  • CellHandle.NOTATION_SCIENTIFIC_EXCEL e.g. "8.002974342+E9"

    For non-numeric values, the value of the cell as a string is returned
    boolean Cell types will return "true" or "false"

    Parameters:
    int - notation one of the CellHandle.NOTATION constants for numeric cell types; ignored for other cell types
    int - notation - notation constant
    Returns:
    String the value of the Cell

  • getStringVal

    public String getStringVal(String encoding)
    Returns the value of the Cell as a String with the specified encoding.
    boolean Cell types will return "true" or "false"

    Parameters:
    String - encoding
    Returns:
    String the value of the Cell

    getFormatId

    public int getFormatId()
    Returns the Formatting record ID (FormatId) for this Cell
    This can be used with 'setFormatId(int i)' to copy the formatting from one Cell to another (e.g. a template cell to a new cell)

    Specified by:
    getFormatId in interface Cell
    Returns:
    int the FormatId for this Cell

    getConditionalFormatId

    public int getConditionalFormatId()
    get the conditional formatting record ID (FormatId)
    returns the normal FormatId if the condition(s) in the conditional format have not been met

    Returns:
    int the conditional format id

    moveToRow

    public void moveToRow(int newrow)
                   throws com.extentech.formats.XLS.CellPositionConflictException
    move this cell to another row
    throws CellPositionConflictException if there is a cell in that position already

    Parameters:
    int - newrow - new row number
    Throws:
    com.extentech.formats.XLS.CellPositionConflictException

    moveToCol

    public void moveToCol(String newcol)
                   throws com.extentech.formats.XLS.CellPositionConflictException
    move this cell to another column
    throws CellPositionConflictException if there is a cell in that position already

    Parameters:
    String - newcol - the new column in alpha format e.g. "A", "B" ...
    Throws:
    com.extentech.formats.XLS.CellPositionConflictException

    copyFormat

    public void copyFormat(CellHandle source)
    Copy all formats from a source Cell to this Cell

    Parameters:
    CellHandle - source - source cell

    copyTo

    public CellHandle copyTo(String newaddr)
                      throws com.extentech.formats.XLS.CellPositionConflictException
    copy this Cell to another location.

    Parameters:
    String - newaddr - address for copy of this Cell in Excel-style e.g. "A1"
    Returns:
    returns the newly copied CellHandle
    Throws:
    com.extentech.formats.XLS.CellPositionConflictException - if there is a cell in the new address already

    remove

    public void remove(boolean nullme)
    Removes this Cell from the WorkSheet

    Parameters:
    boolean - nullme - true if this CellHandle should be nullified after removal

    moveTo

    public void moveTo(String newaddr)
                throws com.extentech.formats.XLS.CellPositionConflictException
    move this cell to another location.

    Parameters:
    String - newaddr - the new address for Cell in Excel-style notation e.g. "A1"
    Throws:
    com.extentech.formats.XLS.CellPositionConflictException - if there is a cell in the new address already

    addConditionalFormat

    public void addConditionalFormat(ConditionalFormatHandle format)
    Set a conditional format upon this cell. Note that conditional format handles are bound to a specific worksheet,

    Parameters:
    format - A ConditionalFormatHandle in the same worksheet

    getConditionallyFormattedHandles

    public FormatHandle[] getConditionallyFormattedHandles()
    returns an array of FormatHandles for the Cell that have the current conditional format applied to them. This behavior is still in testing, and may change

    Returns:
    an array of FormatHandles, one for each of the Conditional Formatting rules

    getConditionalFormatHandles

    public ConditionalFormatHandle[] getConditionalFormatHandles()
    return all the ConditionalFormatHandles for this Cell, if any

    Returns:

    getFormatHandle

    public FormatHandle getFormatHandle()
    Gets the FormatHandle (a Format Object describing the formats for this Cell) for this Cell.

    Returns:
    FormatHandle for this Cell

    setLocked

    public void setLocked(boolean locked)
    locks or unlocks this Cell for editing

    Parameters:
    boolean - locked - true if Cell should be locked, false otherwise

    setFormulaHidden

    public void setFormulaHidden(boolean hidden)
    Hides or shows the formula for this Cell, if present

    Parameters:
    boolean - hidden - setting whether to hide or show formulas for this Cell

    setFormatHandle

    public void setFormatHandle(FormatHandle f)
    Sets the FormatHandle (a Format Object describing the formats for this Cell) for this Cell

    Parameters:
    FormatHandle - to apply to this Cell
    See Also:
    FormatHandle

    setFormatId

    public void setFormatId(int i)
    Sets the Formatting record ID (FormatId) for this Cell This can be used with 'getFormatId()' to copy the formatting from one Cell to another (ie: a template cell to a new cell)

    Parameters:
    int - i - the new index to the Format for this Cell

    clearFormats

    public void clearFormats()
    Resets this cell's format to the default.


    clearContents

    public void clearContents()
    Resets this cells contents to blank.


    clear

    public void clear()
    Resets this cell to the default, as if it had just been added.


    getFormulaHandle

    public FormulaHandle getFormulaHandle()
                                   throws com.extentech.formats.XLS.FormulaNotFoundException
    Returns the Formula Handle (an Object describing a Formula) for this Cell, if it contains a formula

    Returns:
    FormulaHandle the Formula of the Cell
    Throws:
    com.extentech.formats.XLS.FormulaNotFoundException
    See Also:
    FormulaHandle

    getURL

    public String getURL()
    Returns the Hyperlink URL String for this Cell, if any

    Returns:
    String URL if this Cell contains a hyperlink

    getURLDescription

    public String getURLDescription()
    Returns the URL Description String for this Cell, if any

    Returns:
    String URL Description, if this Cell contains a hyperlink

    hasHyperlink

    public boolean hasHyperlink()
    returns true if this Cell contains a hyperlink

    Returns:
    boolean true if this Cell contains a hyperlink

    setURL

    public void setURL(String urlstr)
    Creates a new Hyperlink for this Cell from a URL String. Can be any valid URL. This URL String must include the protocol.
    For Example, "http://www.extentech.com/"
    To remove a hyperlink, pass in null for the URL String

    Parameters:
    String - urlstr - the URL String for this Cell

    setURL

    public void setURL(String urlstr,
                       String desc,
                       String textMark)
    Creates a new Hyperlink for this Cell from a URL String, a descrpiton and textMark text.

    The URL String Can be any valid URL. This URL String must include the protocol. For Example, "http://www.extentech.com/"
    The textMark text is the porition of the URL that follows #

    NOTE: URL text and textMark text must not be null or ""

    Parameters:
    String - urlstr - the URL String
    String - desc - the description text
    String - textMark - the text that follows #

    setFileURL

    public void setFileURL(String fileURLStr)
    Sets a hyperlink to a location within the current template
    The URL String should be prefixed with "file://"

    Parameters:
    String - fileURLStr - the file URL String

    setFileURL

    public void setFileURL(String fileURLstr,
                           String desc,
                           String textMark)
    Sets a hyperlink to a location within the current template, and includes additional optional information: description + textMark text

    The URL String should be prefixed with "file://"

    The textMark text is the porition of the URL that follows #

    Parameters:
    String - fileURLstr - the file URL String
    String - desc - the description text
    String - textMark - text that follows #

    setVal

    public void setVal(Object obj)
                throws com.extentech.formats.XLS.CellTypeMismatchException
    Set the val of this Cell to an object

    The object may be one of type:
    String, Float, Integer, Double, Long, Boolean, java.sql.Date, or null

    To set a Cell to a formula, obj should be a string begining with "="

    To set a Cell to an array formula, obj should be a string begining with "{="
    If you wish to put a line break in a string value, use the newline "\n" character. Note this will not function unless you also apply a format handle to the cell with WrapText=true

    Parameters:
    Object - obj - the object to set the value of the Cell to
    Throws:
    com.extentech.formats.XLS.CellTypeMismatchException

    setStringVal

    public void setStringVal(String s)
    set the value of this cell to String s
    NOTE: this method will not check for formula references or do any data conversions
    This method is useful when a string may start with = but you do not want to convert to a Formula value If you wish to put a line break in the string use the newline "\n" character. Note this will not function unless you also apply a format handle to the cell with WrapText=true

    Parameters:
    String - s - the String value to set the Cell to
    Throws:
    com.extentech.formats.XLS.CellTypeMismatchException
    See Also:
    setVal(Object obj)

    setStringVal

    public void setStringVal(com.extentech.formats.XLS.Unicodestring us)
    set the value of this cell to Unicodestring us
    NOTE: This method will not check for formula references or do any data conversions
    Useful when strings may start with = but you do not want to convert to a formula value

    Parameters:
    Unicodestring - us - Unicode String
    Throws:
    com.extentech.formats.XLS.CellTypeMismatchException

    fireParserEvent

    public void fireParserEvent()
    this method will be fired as each record is parsed from an input Spreadsheet Dec 15, 2010


    toString

    public String toString()
    Returns a String representation of this CellHandle

    Overrides:
    toString in class Object
    See Also:
    Object.toString()

    setVal

    public void setVal(double d)
                throws com.extentech.formats.XLS.CellTypeMismatchException
    Set the Value of the Cell to a double

    Parameters:
    double - d- double value to set this Cell to
    Throws:
    com.extentech.formats.XLS.CellTypeMismatchException

    setVal

    public void setVal(float f)
                throws com.extentech.formats.XLS.CellTypeMismatchException
    Set value of this Cell to a Float

    Parameters:
    float - f - float value to set this Cell to
    Throws:
    com.extentech.formats.XLS.CellTypeMismatchException

    setVal

    public void setVal(Date dt,
                       String fmt)
    Sets the value of this Cell to a java.sql.Date.
    You must also specify a formatting pattern for the new date, or null for the default date format ("m/d/yy h:mm".)

    valid date format patterns:
    "m/d/y"
    "d-mmm-yy"
    "d-mmm"
    "mmm-yy"
    "h:mm AM/PM"
    "h:mm:ss AM/PM"
    "h:mm"
    "h:mm:ss"
    "m/d/yy h:mm"
    "mm:ss"
    "[h]:mm:ss"
    "mm:ss.0"

    Parameters:
    java.sql.Date - dt - the value of the new Cell
    String - fmt - date formatting pattern

    setVal

    public void setVal(boolean b)
                throws com.extentech.formats.XLS.CellTypeMismatchException
    Sets the value of this Cell to a boolean value

    Parameters:
    boolean - b - boolean value to set this Cell to
    Throws:
    com.extentech.formats.XLS.CellTypeMismatchException

    setVal

    public void setVal(int i)
                throws com.extentech.formats.XLS.CellTypeMismatchException
    Set the value of this Cell to an int value
    NOTE: setting a Boolean Cell type to a zero or a negative number will set the Cell to 'false'; setting it to an int value 1 or greater will set it to true.

    Parameters:
    int - i - int value to set this Cell to
    Throws:
    com.extentech.formats.XLS.CellTypeMismatchException

    getDoubleVal

    public double getDoubleVal()
    returns the value of this Cell as a double, if possible, or NaN if Cell value cannot be converted to double

    Returns:
    double value or NaN if the Cell value cannot be converted to a double

    getIntVal

    public int getIntVal()
    returns the value of this Cell as a int, if possible, or NaN if Cell value cannot be converted to int

    Returns:
    int value or NaN if the Cell value cannot be converted to an int

    getFloatVal

    public float getFloatVal()
    returns the value of this Cell as a float, if possible, or NaN if Cell value cannot be converted to float

    Returns:
    float value or NaN if the Cell value cannot be converted to an float

    getBooleanVal

    public boolean getBooleanVal()
    returns the value of this Cell as a boolean
    If the Cell is not of type Boolean, returns false

    Returns:
    boolean value of cell

    setFormula

    public void setFormula(String formStr)
                    throws com.extentech.formats.XLS.FunctionNotSupportedException
    Set a cell to Excel-compatible formula passed in as String.

    Parameters:
    String - formStr - the Formula String
    Throws:
    com.extentech.formats.XLS.FunctionNotSupportedException - if unable to parse string correctly

    setFormula

    public void setFormula(String formStr,
                           Object value)
                    throws Exception
    Set a cell to formula passed in as String. Sets the cachedValue as well, so no calculating is necessary. Parses the string to convert into a Excel formula.
    IMPORTANT NOTE: if cell is ALREADY a formula String this method will NOT reset it

    Parameters:
    String - formulaStr - The excel-compatible formula string to pass in
    Object - value - The calculated value of the formula
    Throws:
    Exception - if unable to parse string correctly

    setFormula

    public void setFormula(Stack newExp,
                           Object value)
    sets the formula for this cellhandle using a stack of Ptgs appropriate for formula records. This method also sets the cachedValue of the formula as well, so no new calculating is necessary.

    Parameters:
    Stack - newExp - Stack of Ptgs
    Object - value - calculated value of formula

    getSpan

    public int[] getSpan(int row,
                         int column)
    returns the size of the Merged Cell area if this Cell is a part of a Merged Cell area

    Specified by:
    getSpan in interface com.extentech.swingtools.table.CellSpan
    Parameters:
    int - row -
    int - column -
    Returns:
    a 2 position int array with number of rows and number of cols

    setSpan

    public void setSpan(int[] span,
                        int row,
                        int column)
    internal UI interface implementation -- do not use

    Specified by:
    setSpan in interface com.extentech.swingtools.table.CellSpan

    isVisible

    public boolean isVisible(int row,
                             int column)
    returns whether this Cell is visible in UI implementations.

    Specified by:
    isVisible in interface com.extentech.swingtools.table.CellSpan
    Parameters:
    int - row -
    int - column -
    Returns:
    boolean true if this Cell is visible

    combine

    public void combine(int[] x,
                        int[] y)
    unimplemented - do not use

    Specified by:
    combine in interface com.extentech.swingtools.table.CellSpan

    split

    public void split(int row,
                      int column)
    internal UI interface implementation -- do not use


    getWorkBook

    public WorkBook getWorkBook()
    returns the WorkBookHandle for this Cell

    Returns:
    WorkBook the book

    getSheetNum

    public int getSheetNum()
    get the index of the WorkSheet containing this Cell in the list of sheets

    Returns:
    int the WorkSheetHandle index for this Cell

    getWorkSheetHandle

    public WorkSheetHandle getWorkSheetHandle()
    get the WorkSheetHandle for this Cell

    Returns:
    the WorkSheetHandle for this Cell

    isDefaultCell

    public boolean isDefaultCell()
    Determines if the cellHandle represents a completely blank/null cell, and can thus be ignored for many operations. Criteria for returning true is a cell type of BLANK, that has a default format id (15), is not part of a merge range, does not contain a URL, and is not a part of a validation

    Returns:
    true if cell is truly blank

    setWorkSheetHandle

    public void setWorkSheetHandle(WorkSheetHandle handle)
    set the WorkSheetHandle for this Cell

    Parameters:
    WorkSheetHandle - handle - the new worksheet for this Cell
    See Also:
    WorkSheetHandle

    getXML

    public String getXML()
    Returns an XML representation of the cell and it's component data

    Returns:
    String of XML

    getXML

    public String getXML(int[] mergedRange)
    Returns an XML representation of the cell and it's component data

    Parameters:
    int[] - mergedRange - include merged ranges in the XML representation if not null
    Returns:
    String of XML

    setHorizontalAlignment

    public void setHorizontalAlignment(int align)
    Set the horizontal alignment for this Cell

    Parameters:
    int - align - constant value representing the horizontal alignment.
    See Also:
    constants

    getHorizontalAlignment

    public int getHorizontalAlignment()
    Returns an int representing the current horizontal alignment in this Cell.

    Returns:
    int representing horizontal alignment
    See Also:
    constants

    setVerticalAlignment

    public void setVerticalAlignment(int align)
    Set the Vertical alignment for this Cell

    Parameters:
    int - align - constant value representing the vertical alignment.
    See Also:
    constants

    getVerticalAlignment

    public int getVerticalAlignment()
    Returns an int representing the current vertical alignment in this Cell.

    Returns:
    int representing vertical alignment
    See Also:
    constants

    setWrapText

    public void setWrapText(boolean wrapit)
    Sets the cell wrapping behavior for this cell

    Parameters:
    boolean - wrapit - true if cell text should be wrapped (default is false)

    getWrapText

    public boolean getWrapText()
    Get the cell wrapping behavior for this cell.

    Returns:
    true if cell text is wrapped

    setCellRotation

    public void setCellRotation(int align)
    Set the rotation of the cell in degrees.
    Values 0-90 represent rotation up, 0-90degrees.
    Values 91-180 represent rotation down, 0-90 degrees.
    Value 255 is vertical

    Parameters:
    int - align - an int representing the rotation.

    getCellRotation

    public int getCellRotation()
    Get the rotation of this Cell in degrees.
    Values 0-90 represent rotation up, 0-90degrees.
    Values 91-180 represent rotation down, 0-90 degrees.
    Value 255 is vertical

    Returns:
    int representing the degrees of cell rotation

    compareTo

    public int compareTo(Object ob)
    compare this Cell (via it's string value i.e. address and value) to another object

    Specified by:
    compareTo in interface Comparable
    Parameters:
    Object - ob - object to compare this CellHandle to
    Returns:
    int comparision result (0 = equal)

    equals

    public boolean equals(Object ob)
    compare this Cells equality (via it's string value i.e. address and value) to another object

    Overrides:
    equals in class Object
    Parameters:
    Object - ob - object to compare this CellHandle to
    Returns:
    true if the objects equal one another

    setScript

    public void setScript(int ss)
    Set the super/sub script for the Font

    Parameters:
    int - ss - super/sub script constant (0 = none, 1 = super, 2 = sub)

    calculateAffectedCells

    public List calculateAffectedCells()
    Calculates and returns all formulas that reference this CellHandle.
    Please note that these cells may have already been calculated, so in order to get their values without re-calculating them Extentech suggests setting the book level non-calculation flag, ie book.setFormulaCalculationMode(WorkBookHandle.CALCULATE_EXPLICIT); or FormulaHandle.getCachedVal()

    Returns:
    List of of calculated cells (CellHandles)

    calculateAffectedCellsOnSheet

    public List calculateAffectedCellsOnSheet()
    Calculates and returns all formulas on the same sheet that reference this CellHandle.
    Please note that these cells may have already been calculated, so in order to get their values without re-calculating them Extentech suggests setting the book level non-calculation flag, ie book.setFormulaCalculationMode(WorkBookHandle.CALCULATE_EXPLICIT); or FormulaHandle.getCachedVal()

    Returns:
    List of of calculated cells (CellHandles)

    copyCellToWorkSheet

    public static final CellHandle copyCellToWorkSheet(CellHandle sourcecell,
                                                       WorkSheetHandle newsheet,
                                                       int row,
                                                       int col)
                                                throws com.extentech.formats.XLS.CellPositionConflictException,
                                                       com.extentech.formats.XLS.CellNotFoundException
    Creates a copy of this cell on the given worksheet at the given address.

    Parameters:
    sourcecell - the cell to copy
    newsheet - the sheet to which the cell should be copied
    row - the row in which the copied cell should be placed
    col - the row in which the copied cell should be placed
    Returns:
    CellHandle representing the new Cell
    Throws:
    com.extentech.formats.XLS.CellPositionConflictException
    com.extentech.formats.XLS.CellNotFoundException

    copyCellToWorkSheet

    public static CellHandle copyCellToWorkSheet(CellHandle sourcecell,
                                                 WorkSheetHandle newsheet,
                                                 int row,
                                                 int col,
                                                 boolean copyByValue)
    Creates a copy of this cell on the given worksheet at the given address.

    Parameters:
    sourcecell - the cell to copy
    newsheet - the sheet to which the cell should be copied
    row - the row in which the copied cell should be placed
    col - the row in which the copied cell should be placed
    copyByValue - whether to copy formulas' values instead of the formulas themselves
    Returns:
    CellHandle representing the new cell

    copyCellToWorkSheet

    public static final CellHandle copyCellToWorkSheet(CellHandle sourcecell,
                                                       WorkSheetHandle newsheet)
    Create a copy of this Cell in another WorkBook

    Parameters:
    sourcecell - the cell to copy
    target - worksheet to copy this cell into
    Returns:

    getJSON

    public String getJSON()
    Get the JSON object for this cell. Complete documentation TBA

    Returns:
    String representing the JSON for this Cell

    getValidationHandle

    public ValidationHandle getValidationHandle()
    Returns the validation handle for the cell.

    Returns:
    ValidationHandle for this Cell, or null if none


    Copyright © 2011 Extentech Inc. All Rights Reserved.