Package io.keikai.model.impl
Class CellImpl
- java.lang.Object
-
- io.keikai.model.impl.AbstractCellAdv
-
- io.keikai.model.impl.CellImpl
-
- All Implemented Interfaces:
CellStyleHolder
,FormulaContent
,LinkedModelObject
,SCell
,Serializable
public class CellImpl extends AbstractCellAdv
- Since:
- 3.5.0
- Author:
- dennis
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.keikai.model.SCell
SCell.CellType
-
-
Constructor Summary
Constructors Constructor Description CellImpl(AbstractRowAdv row, int index)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkOrphan()
void
clearFormulaResultCache()
Clear the formula result cache if there is evaluation resultvoid
clearValue()
clear cell value , reset it to blankvoid
deleteComment()
Delete the comment associated with this cell.void
destroy()
Destroy / release this model object, for example all the dependency, parent linking.protected void
evalFormula()
CellRegion
getArrayFormulaRegion()
Only valid for array formula cellsSCellStyle
getCellStyle()
Get the style, if it doesn't has local style, it will possible look up it's parent's styleSCellStyle
getCellStyle(boolean local)
Get the cell style locally or look up from the parentint
getColumnIndex()
SComment
getComment()
CellValue
getEvalCellValue(boolean evaluatedVal)
FormulaExpression
getFormulaExpression()
SCell.CellType
getFormulaResultType()
Object
getFromulaResultValue()
SHyperlink
getHyperlink()
Object
getInitValue()
protected Ref
getRef()
String
getReferenceString()
int
getRowIndex()
SSheet
getSheet()
int
getTextHeight()
int
getTextWidth()
SCell.CellType
getType()
Object
getValue(boolean evaluatedVal)
boolean
isCalcAutoHeight()
boolean
isFormulaParsingError()
boolean
isNull()
Because you always get a not-null cell object, use this method to judge the cell is really null or not.boolean
isPartOfArrayFormulaGroup()
void
setCalcAutoHeight(boolean b)
void
setCellStyle(SCellStyle cellStyle)
Set the local stylevoid
setComment(SComment comment)
void
setFormulaResultValue(ValueEval value)
void
setFormulaValue(String formula)
set formula with string without '=', e.g.void
setFormulaValue(String formula, FormulaType formulaType)
void
setFormulaValue(String formula, Locale locale)
void
setFormulaValue(String formula, Locale locale, FormulaType formulaType)
void
setHyperlink(SHyperlink hyperlink)
Set or clear a hyperlinkvoid
setTextHeight(int heightPx)
void
setTextWidth(int widthPx)
void
setValue(Object newVal)
protected void
setValue(Object newVal, boolean aString)
String
toString()
-
Methods inherited from class io.keikai.model.impl.AbstractCellAdv
checkFormulaResultType, checkType, getBooleanValue, getDateValue, getErrorValue, getFormulaValue, getNumberValue, getRichTextValue, getStringValue, getValue, isRichTextValue, setBooleanValue, setDateValue, setErrorValue, setNumberValue, setStringValue, setupComment, setupHyperlink, setupRichTextValue
-
-
-
-
Constructor Detail
-
CellImpl
public CellImpl(AbstractRowAdv row, int index)
-
-
Method Detail
-
getType
public SCell.CellType getType()
- Returns:
- the cell type
-
isNull
public boolean isNull()
Description copied from interface:SCell
Because you always get a not-null cell object, use this method to judge the cell is really null or not.- Returns:
- TRUE if this cell is really null which means it have not been created.
-
getRowIndex
public int getRowIndex()
-
getColumnIndex
public int getColumnIndex()
-
getReferenceString
public String getReferenceString()
- Returns:
- cell reference like A1
-
checkOrphan
public void checkOrphan()
-
getSheet
public SSheet getSheet()
-
destroy
public void destroy()
Description copied from interface:LinkedModelObject
Destroy / release this model object, for example all the dependency, parent linking. this method has to be called before remove this linking from parent object
-
getCellStyle
public SCellStyle getCellStyle()
Description copied from interface:CellStyleHolder
Get the style, if it doesn't has local style, it will possible look up it's parent's style- See Also:
CellStyleHolder.getCellStyle(boolean)
-
getCellStyle
public SCellStyle getCellStyle(boolean local)
Description copied from interface:CellStyleHolder
Get the cell style locally or look up from the parent- Parameters:
local
- true to get the local style only
-
setCellStyle
public void setCellStyle(SCellStyle cellStyle)
Description copied from interface:CellStyleHolder
Set the local style- Parameters:
cellStyle
- the style to set, null to clean local style
-
evalFormula
protected void evalFormula()
-
getInitValue
public Object getInitValue()
- Overrides:
getInitValue
in classAbstractCellAdv
-
getFormulaResultType
public SCell.CellType getFormulaResultType()
-
clearValue
public void clearValue()
Description copied from interface:SCell
clear cell value , reset it to blank
-
setFormulaValue
public void setFormulaValue(String formula)
Description copied from interface:SCell
set formula with string without '=', e.g. SUM(A1:B2)
-
setFormulaValue
public void setFormulaValue(String formula, Locale locale)
- Specified by:
setFormulaValue
in classAbstractCellAdv
-
setFormulaValue
public void setFormulaValue(String formula, FormulaType formulaType)
- Specified by:
setFormulaValue
in classAbstractCellAdv
-
setFormulaValue
public void setFormulaValue(String formula, Locale locale, FormulaType formulaType)
- Specified by:
setFormulaValue
in classAbstractCellAdv
-
clearFormulaResultCache
public void clearFormulaResultCache()
Description copied from interface:FormulaContent
Clear the formula result cache if there is evaluation result
-
isFormulaParsingError
public boolean isFormulaParsingError()
- Returns:
- returns TRUE if it has parsing error, FALSE if no error found or not a formula content
-
getValue
public Object getValue(boolean evaluatedVal)
-
setValue
public void setValue(Object newVal)
-
setValue
protected void setValue(Object newVal, boolean aString)
- Specified by:
setValue
in classAbstractCellAdv
-
getHyperlink
public SHyperlink getHyperlink()
-
setHyperlink
public void setHyperlink(SHyperlink hyperlink)
Description copied from interface:SCell
Set or clear a hyperlink- Parameters:
hyperlink
- hyperlink to set, or null to clear
-
getComment
public SComment getComment()
-
setComment
public void setComment(SComment comment)
-
deleteComment
public void deleteComment()
Description copied from interface:SCell
Delete the comment associated with this cell.
-
getRef
protected Ref getRef()
-
setFormulaResultValue
public void setFormulaResultValue(ValueEval value)
- Specified by:
setFormulaResultValue
in classAbstractCellAdv
-
getFormulaExpression
public FormulaExpression getFormulaExpression()
- Specified by:
getFormulaExpression
in classAbstractCellAdv
-
setTextHeight
@Internal public void setTextHeight(int heightPx)
- Specified by:
setTextHeight
in classAbstractCellAdv
-
getTextHeight
@Internal public int getTextHeight()
- Specified by:
getTextHeight
in classAbstractCellAdv
-
setCalcAutoHeight
@Internal public void setCalcAutoHeight(boolean b)
- Specified by:
setCalcAutoHeight
in classAbstractCellAdv
-
isCalcAutoHeight
@Internal public boolean isCalcAutoHeight()
- Specified by:
isCalcAutoHeight
in classAbstractCellAdv
-
setTextWidth
@Internal public void setTextWidth(int widthPx)
- Specified by:
setTextWidth
in classAbstractCellAdv
-
getTextWidth
@Internal public int getTextWidth()
- Specified by:
getTextWidth
in classAbstractCellAdv
-
getEvalCellValue
public CellValue getEvalCellValue(boolean evaluatedVal)
- Specified by:
getEvalCellValue
in classAbstractCellAdv
-
getArrayFormulaRegion
public CellRegion getArrayFormulaRegion()
Description copied from interface:SCell
Only valid for array formula cells- Returns:
- the region of the array formula group that the cell belongs to.
-
isPartOfArrayFormulaGroup
public boolean isPartOfArrayFormulaGroup()
- Returns:
true
if this cell is part of group of cells having a common array formula.
-
-