public class CellHandle extends Object implements Cell, Serializable, Handle, Comparable<CellHandle>
WorkBookHandle book = newWorkBookHandle("testxls.xls");With a CellHandle you can:
WorkSheetHandle sheet1 = book.getWorkSheet("Sheet1");
CellHandlecell = sheet1.getCell("B22");
| Modifier and Type | Field and Description |
|---|---|
static int |
NOTATION_SCIENTIFIC |
static int |
NOTATION_SCIENTIFIC_EXCEL |
static int |
NOTATION_STANDARD |
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 and Description |
|---|
CellHandle(BiffRec c)
Public Constructor added for use in Bean-context ONLY.
|
CellHandle(BiffRec c,
WorkBook myb)
Public Constructor added for use in Bean-context ONLY.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConditionalFormat(ConditionalFormatHandle format)
Set a conditional format upon this cell.
|
List<CellHandle> |
calculateAffectedCells()
Calculates and returns all formulas that reference this CellHandle.
|
List<CellHandle> |
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.
|
protected void |
clearAffectedCells()
Internal method for clearing affected cells, does the same thing as
calculateAffectedCells, but does not create a list
|
void |
clearChartReferences()
flags chart references to the particular cell as dirty/ needing caches
rebuilt
|
void |
clearContents()
Resets this cells contents to blank.
|
void |
clearFormats()
Resets this cell's format to the default.
|
int |
compareTo(CellHandle that) |
protected static CellHandle |
copyCellHelper(CellHandle sourcecell,
CellHandle newcell)
Copies all formatting - xf and non-xf (such as column width, hidden state)
plus merged cell range from a sourcecell to a new cell (usually in a new
workbook)
|
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 that) |
void |
fireParserEvent()
this method will be fired as each record is parsed from an input Spreadsheet
Dec 15, 2010
|
Font |
getAwtFont()
convert the OpenXLS 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.
|
BiffRec |
getCell()
return the underlying cell record
for internal API use only |
String |
getCellAddress()
Returns the Address of this Cell as a String.
|
String |
getCellAddressWithSheet()
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
|
protected static String |
getEmptyCellXML(String loc,
boolean isVisible)
Returns an xml representation of an empty cell
|
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
|
Font |
getFont()
Get the OpenXLS 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.
|
String |
getFormattedStringVal(boolean formatForXML)
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[] |
getIntLocation() |
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.
|
org.json.JSONObject |
getJSONObject()
Get the JSON object for this cell.
|
org.json.JSONObject |
getJSONObject(int[] mergedRange)
Deprecated.
The
mergedRange parameter is unnecessary. This method
will be removed in a future version. Use getJSONObject()
instead. |
CellRange |
getMergedCellRange()
Returns any other Cells merged with this one, or null if this Cell is not a
part of a merged range.
|
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)
Deprecated.
since October 2012. This method duplicates the functionality of
getMergedCellRange(), which it calls internally. That
method should be used instead. |
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
|
int |
hashCode() |
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
|
void |
moveAndOverwriteTo(String newaddr)
move this cell to another location, overwriting any cells that are in the way
|
void |
moveAndOverwriteToRow(int newrow)
move this cell to another row
overwrite any cells in the destination |
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 |
removeBorder()
removes the borders for this cell
|
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 |
setBlankRef(int c) |
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(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 |
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(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
|
String |
toString()
Returns a String representation of this CellHandle
|
public static final int TYPE_BLANK
public static final int TYPE_STRING
public static final int TYPE_FP
public static final int TYPE_INT
public static final int TYPE_FORMULA
public static final int TYPE_BOOLEAN
public static final int TYPE_DOUBLE
public static final int NOTATION_STANDARD
public static final int NOTATION_SCIENTIFIC
public static final int NOTATION_SCIENTIFIC_EXCEL
public CellHandle(BiffRec c)
public XLSRecord getRecord()
public void setRecord(XLSRecord rec)
XLSRecord - rec - The BIFF record to set.public void setToDefault()
public Object getDefaultVal()
public void setFormatPattern(String pat)
getFormattedStringVal() method) but they will be written correctly
to the output file. For more information on number format patterns see
Microsoft KB264372.pat - the Excel number format pattern to applyFormatConstantsImpl.getBuiltinFormats()public String getFormatPattern()
null if
none is appliedpublic boolean isDate()
public boolean isFormula()
public boolean isFormulaHidden()
public boolean isLocked()
public boolean isBlank()
public boolean isCurrency()
public boolean isNumber()
public void setFontSize(int sz)
int - sz - Font size in Points.public void setFontWeight(int wt)
int - wt - Font weight range between 100-1000public void setBold(boolean bold)
boolean - bold - true if boldpublic int getFontWeight()
public int getFontSize()
public Color getFontColor()
constantspublic void setFontColor(Color col)
java - .Awt.Color col - color of the fontpublic void setForegroundColor(int t)
int - t - Excel color constantconstantspublic void setForeColor(int i)
int - Excel color constantconstantspublic void setBackgroundColor(int t)
int - t - Excel color constantconstantspublic Color getForegroundColor()
public void setForegroundColor(Color col)
java - .awt.Color col - color for the foregroundpublic Color getBackgroundColor()
public Color getCellBackgroundColor()
public void setBackgroundColor(Color col)
java - .awt.Color col - background colorpublic void setCellBackgroundColor(int t)
int - t - Excel color constant for Cell Background colorpublic void setCellBackgroundColor(Color col)
java - .awt.Color col - color of the cell backgroundpublic void setPatternBackgroundColor(Color col)
java - .awt.Color col - color of the pattern backgroundpublic void setBackgroundPattern(int t)
int - t - Excel pattern constantconstantspublic int getBackgroundPattern()
constantspublic int getFillPattern()
constantspublic void setBorderColor(Color col)
java - .awt.Color col - border colorpublic void setBorderRightColor(Color col)
java - .awt.Color col - right border colorpublic void setBorderLeftColor(Color col)
java - .awt.Color col - left border colorpublic void setBorderTopColor(Color col)
java - .awt.Color col - top border colorpublic void setBorderBottomColor(Color col)
java - .awt.Color col - bottom border colorpublic String getFontFace()
public void setFontFace(String fn)
String - fn - system name of the fontpublic void setBorderLineStyle(short s)
short - s - border constantline style constantspublic void setRightBorderLineStyle(short s)
short - s - border constantline style constantspublic void setLeftBorderLineStyle(short s)
short - s - border constantline style constantspublic void setTopBorderLineStyle(short s)
short - s - border constantline style constantspublic void setBottomBorderLineStyle(short s)
short - s - border constantline style constantspublic void removeBorder()
public Font getFont()
public Font getAwtFont()
public void setFont(String fn, int stl, int sz)
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 pointspublic CommentHandle getComment() throws DocumentObjectNotFoundException
DocumentObjectNotFoundExceptionpublic void removeComment()
public CommentHandle createComment(String comment, String author)
comment - -- text of noteauthor - -- name of authorCommentHandlepublic boolean getIsUnderlined()
public void setUnderlined(boolean isUnderlined)
boolean - b - true if the Font for this Cell should be underlined (single
underline only)public void setFontColor(int t)
int - t - Excel color constantpublic CellRange getMergedCellRange()
public boolean isMergeParent()
public ColHandle getCol()
public RowHandle getRow()
public Object getVal()
public String getCellTypeName()
public int getCellType()
getCellType in interface Cellpublic BiffRec getCell()
public Color[] getBorderColors()
public byte[] getBytes()
public int getColNum()
public int getRowNum()
public String getCellAddress()
getCellAddress in interface Cellpublic int[] getIntLocation()
public String getCellAddressWithSheet()
public void setBlankRef(int c)
public String getWorkSheetName()
getWorkSheetName in interface Cellpublic String getStringVal()
public String getFormattedStringVal()
getFormattedStringVal in interface Cellpublic String getFormattedStringVal(boolean formatForXML)
formatForXML - if true non-compliant characters will be properly qualifiedpublic String getStringVal(int notation)
int - notation one of the CellHandle.NOTATION constants for numeric cell
types; ignored for other cell typesint - notation - notation constantpublic String getStringVal(String encoding)
String - encodingpublic int getFormatId()
getFormatId in interface Cellpublic int getConditionalFormatId()
public void moveToRow(int newrow)
throws CellPositionConflictException
int - newrow - new row numberCellPositionConflictExceptionpublic void moveAndOverwriteToRow(int newrow)
int - newrow - new row numberpublic void moveToCol(String newcol) throws CellPositionConflictException
String - newcol - the new column in alpha format e.g. "A", "B" ...CellPositionConflictExceptionpublic void copyFormat(CellHandle source)
CellHandle - source - source cellpublic CellHandle copyTo(String newaddr) throws CellPositionConflictException
String - newaddr - address for copy of this Cell in Excel-style e.g. "A1"CellPositionConflictException - if there is a cell in the new address alreadypublic void remove(boolean nullme)
boolean - nullme - true if this CellHandle should be nullified after removalpublic void moveTo(String newaddr) throws CellPositionConflictException
String - newaddr - the new address for Cell in Excel-style notation e.g.
"A1"CellPositionConflictException - if there is a cell in the new address alreadypublic void moveAndOverwriteTo(String newaddr)
String - newaddr - the new address for Cell in Excel-style notation e.g.
"A1"public void addConditionalFormat(ConditionalFormatHandle format)
format - A ConditionalFormatHandle in the same worksheetpublic FormatHandle[] getConditionallyFormattedHandles()
public ConditionalFormatHandle[] getConditionalFormatHandles()
public FormatHandle getFormatHandle()
public void setLocked(boolean locked)
boolean - locked - true if Cell should be locked, false otherwisepublic void setFormulaHidden(boolean hidden)
boolean - hidden - setting whether to hide or show formulas for this Cellpublic void setFormatHandle(FormatHandle f)
FormatHandle - to apply to this CellFormatHandlepublic void setFormatId(int i)
int - i - the new index to the Format for this Cellpublic void clearFormats()
public void clearContents()
public void clear()
public FormulaHandle getFormulaHandle() throws FormulaNotFoundException
FormulaNotFoundExceptionFormulaHandlepublic String getURL()
public String getURLDescription()
public boolean hasHyperlink()
public void setURL(String urlstr)
String - urlstr - the URL String for this Cellpublic void setURL(String urlstr, String desc, String textMark)
String - urlstr - the URL StringString - desc - the description textString - textMark - the text that follows #public void setFileURL(String fileURLStr)
String - fileURLStr - the file URL Stringpublic void setFileURL(String fileURLstr, String desc, String textMark)
String - fileURLstr - the file URL StringString - desc - the description textString - textMark - text that follows #public void setVal(Object obj) throws CellTypeMismatchException
Object - obj - the object to set the value of the Cell toCellTypeMismatchExceptionpublic void setStringVal(String s)
String - s - the String value to set the Cell toCellTypeMismatchExceptionsetVal(Object obj)public void setStringVal(Unicodestring us)
Unicodestring - us - Unicode StringCellTypeMismatchExceptionpublic void fireParserEvent()
public String toString()
toString in class ObjectObject.toString()public void setVal(double d)
throws CellTypeMismatchException
double - d- double value to set this Cell toCellTypeMismatchExceptionpublic void setVal(float f)
throws CellTypeMismatchException
float - f - float value to set this Cell toCellTypeMismatchExceptionpublic void setVal(Date dt, String fmt)
java - .sql.Date dt - the value of the new CellString - fmt - date formatting patternpublic void setVal(boolean b)
throws CellTypeMismatchException
boolean - b - boolean value to set this Cell toCellTypeMismatchExceptionpublic void setVal(int i)
throws CellTypeMismatchException
int - i - int value to set this Cell toCellTypeMismatchExceptionpublic double getDoubleVal()
public int getIntVal()
public float getFloatVal()
public boolean getBooleanVal()
public void setFormula(String formStr) throws FunctionNotSupportedException
String - formStr - the Formula StringFunctionNotSupportedException - if unable to parse string correctlypublic void setFormula(String formStr, Object value) throws Exception
String - formulaStr - The excel-compatible formula string to pass inObject - value - The calculated value of the formulaException - if unable to parse string correctlypublic void setFormula(Stack<?> newExp, Object value)
Stack - newExp - Stack of PtgsObject - value - calculated value of formula@Deprecated public int[] getSpan(int row, int column)
getMergedCellRange(), which it calls internally. That
method should be used instead.row - this parameter is ignoredcolumn - this parameter is ignoredpublic WorkBook getWorkBook()
public int getSheetNum()
public WorkSheetHandle getWorkSheetHandle()
public boolean isDefaultCell()
public void setWorkSheetHandle(WorkSheetHandle handle)
WorkSheetHandle - handle - the new worksheet for this CellWorkSheetHandlepublic String getXML()
public String getXML(int[] mergedRange)
int[] - mergedRange - include merged ranges in the XML representation if
not nullpublic void setHorizontalAlignment(int align)
int - align - constant value representing the horizontal alignment.constantspublic int getHorizontalAlignment()
constantspublic void setVerticalAlignment(int align)
int - align - constant value representing the vertical alignment.constantspublic int getVerticalAlignment()
constantspublic void setWrapText(boolean wrapit)
boolean - wrapit - true if cell text should be wrapped (default is false)public boolean getWrapText()
public void setCellRotation(int align)
int - align - an int representing the rotation.public int getCellRotation()
public int compareTo(CellHandle that)
compareTo in interface Comparable<CellHandle>public void setScript(int ss)
int - ss - super/sub script constant (0 = none, 1 = super, 2 = sub)protected static String getEmptyCellXML(String loc, boolean isVisible)
loc - - the cell addressisVisible - - if the cell is visible (not hidden)public List<CellHandle> calculateAffectedCells()
protected void clearAffectedCells()
public List<CellHandle> calculateAffectedCellsOnSheet()
public void clearChartReferences()
public static final CellHandle copyCellToWorkSheet(CellHandle sourcecell, WorkSheetHandle newsheet, int row, int col) throws CellPositionConflictException, CellNotFoundException
sourcecell - the cell to copynewsheet - the sheet to which the cell should be copiedrow - the row in which the copied cell should be placedcol - the row in which the copied cell should be placedCellPositionConflictExceptionCellNotFoundExceptionpublic static CellHandle copyCellToWorkSheet(CellHandle sourcecell, WorkSheetHandle newsheet, int row, int col, boolean copyByValue)
sourcecell - the cell to copynewsheet - the sheet to which the cell should be copiedrow - the row in which the copied cell should be placedcol - the row in which the copied cell should be placedcopyByValue - whether to copy formulas' values instead of the formulas
themselvespublic static final CellHandle copyCellToWorkSheet(CellHandle sourcecell, WorkSheetHandle newsheet)
sourcecell - the cell to copytarget - worksheet to copy this cell intopublic String getJSON()
public org.json.JSONObject getJSONObject()
@Deprecated public org.json.JSONObject getJSONObject(int[] mergedRange)
mergedRange parameter is unnecessary. This method
will be removed in a future version. Use getJSONObject()
instead.public ValidationHandle getValidationHandle()
protected static final CellHandle copyCellHelper(CellHandle sourcecell, CellHandle newcell)
sourcecell - the cell to copynewcell - the cell to copy toCopyright © 2002–2019 Starter Inc.. All rights reserved.