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 voidcheckOrphan()voidclearFormulaResultCache()Clear the formula result cache if there is evaluation resultvoidclearValue()clear cell value , reset it to blankvoiddeleteComment()Delete the comment associated with this cell.voiddestroy()Destroy / release this model object, for example all the dependency, parent linking.protected voidevalFormula()CellRegiongetArrayFormulaRegion()Only valid for array formula cellsSCellStylegetCellStyle()Get the style, if it doesn't has local style, it will possible look up it's parent's styleSCellStylegetCellStyle(boolean local)Get the cell style locally or look up from the parentintgetColumnIndex()SCommentgetComment()CellValuegetEvalCellValue(boolean evaluatedVal)FormulaExpressiongetFormulaExpression()SCell.CellTypegetFormulaResultType()ObjectgetFromulaResultValue()SHyperlinkgetHyperlink()ObjectgetInitValue()protected RefgetRef()StringgetReferenceString()intgetRowIndex()SSheetgetSheet()intgetTextHeight()intgetTextWidth()SCell.CellTypegetType()ObjectgetValue(boolean evaluatedVal)booleanisCalcAutoHeight()booleanisFormulaParsingError()booleanisNull()Because you always get a not-null cell object, use this method to judge the cell is really null or not.booleanisPartOfArrayFormulaGroup()voidsetCalcAutoHeight(boolean b)voidsetCellStyle(SCellStyle cellStyle)Set the local stylevoidsetComment(SComment comment)voidsetFormulaResultValue(ValueEval value)voidsetFormulaValue(String formula)set formula with string without '=', e.g.voidsetFormulaValue(String formula, FormulaType formulaType)voidsetFormulaValue(String formula, Locale locale)voidsetFormulaValue(String formula, Locale locale, FormulaType formulaType)voidsetHyperlink(SHyperlink hyperlink)Set or clear a hyperlinkvoidsetTextHeight(int heightPx)voidsetTextWidth(int widthPx)voidsetValue(Object newVal)protected voidsetValue(Object newVal, boolean aString)StringtoString()-
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:SCellBecause 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:LinkedModelObjectDestroy / 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:CellStyleHolderGet 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:CellStyleHolderGet 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:CellStyleHolderSet the local style- Parameters:
cellStyle- the style to set, null to clean local style
-
evalFormula
protected void evalFormula()
-
getInitValue
public Object getInitValue()
- Overrides:
getInitValuein classAbstractCellAdv
-
getFormulaResultType
public SCell.CellType getFormulaResultType()
-
clearValue
public void clearValue()
Description copied from interface:SCellclear cell value , reset it to blank
-
setFormulaValue
public void setFormulaValue(String formula)
Description copied from interface:SCellset formula with string without '=', e.g. SUM(A1:B2)
-
setFormulaValue
public void setFormulaValue(String formula, Locale locale)
- Specified by:
setFormulaValuein classAbstractCellAdv
-
setFormulaValue
public void setFormulaValue(String formula, FormulaType formulaType)
- Specified by:
setFormulaValuein classAbstractCellAdv
-
setFormulaValue
public void setFormulaValue(String formula, Locale locale, FormulaType formulaType)
- Specified by:
setFormulaValuein classAbstractCellAdv
-
clearFormulaResultCache
public void clearFormulaResultCache()
Description copied from interface:FormulaContentClear 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:
setValuein classAbstractCellAdv
-
getHyperlink
public SHyperlink getHyperlink()
-
setHyperlink
public void setHyperlink(SHyperlink hyperlink)
Description copied from interface:SCellSet 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:SCellDelete the comment associated with this cell.
-
getRef
protected Ref getRef()
-
setFormulaResultValue
public void setFormulaResultValue(ValueEval value)
- Specified by:
setFormulaResultValuein classAbstractCellAdv
-
getFormulaExpression
public FormulaExpression getFormulaExpression()
- Specified by:
getFormulaExpressionin classAbstractCellAdv
-
setTextHeight
@Internal public void setTextHeight(int heightPx)
- Specified by:
setTextHeightin classAbstractCellAdv
-
getTextHeight
@Internal public int getTextHeight()
- Specified by:
getTextHeightin classAbstractCellAdv
-
setCalcAutoHeight
@Internal public void setCalcAutoHeight(boolean b)
- Specified by:
setCalcAutoHeightin classAbstractCellAdv
-
isCalcAutoHeight
@Internal public boolean isCalcAutoHeight()
- Specified by:
isCalcAutoHeightin classAbstractCellAdv
-
setTextWidth
@Internal public void setTextWidth(int widthPx)
- Specified by:
setTextWidthin classAbstractCellAdv
-
getTextWidth
@Internal public int getTextWidth()
- Specified by:
getTextWidthin classAbstractCellAdv
-
getEvalCellValue
public CellValue getEvalCellValue(boolean evaluatedVal)
- Specified by:
getEvalCellValuein classAbstractCellAdv
-
getArrayFormulaRegion
public CellRegion getArrayFormulaRegion()
Description copied from interface:SCellOnly valid for array formula cells- Returns:
- the region of the array formula group that the cell belongs to.
-
isPartOfArrayFormulaGroup
public boolean isPartOfArrayFormulaGroup()
- Returns:
trueif this cell is part of group of cells having a common array formula.
-
-