Class CellImpl

All Implemented Interfaces:
CellStyleHolder, FormulaContent, LinkedModelObject, SCell, Serializable

public class CellImpl extends AbstractCellAdv
Since:
3.5.0
Author:
dennis
See Also:
  • Constructor Details

  • Method Details

    • 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:
    • 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 class AbstractCellAdv
    • 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 class AbstractCellAdv
    • setFormulaValue

      public void setFormulaValue(String formula, FormulaType formulaType)
      Specified by:
      setFormulaValue in class AbstractCellAdv
    • setFormulaValue

      public void setFormulaValue(String formula, Locale locale, FormulaType formulaType)
      Specified by:
      setFormulaValue in class AbstractCellAdv
    • 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 class AbstractCellAdv
    • 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()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • setFormulaResultValue

      public void setFormulaResultValue(org.apache.poi.ss.formula.eval.ValueEval value)
      Specified by:
      setFormulaResultValue in class AbstractCellAdv
    • getFormulaExpression

      public FormulaExpression getFormulaExpression()
      Specified by:
      getFormulaExpression in class AbstractCellAdv
    • getFromulaResultValue

      @Internal public Object getFromulaResultValue()
    • setTextHeight

      @Internal public void setTextHeight(int heightPx)
      Specified by:
      setTextHeight in class AbstractCellAdv
    • getTextHeight

      @Internal public int getTextHeight()
      Specified by:
      getTextHeight in class AbstractCellAdv
    • setCalcAutoHeight

      @Internal public void setCalcAutoHeight(boolean b)
      Specified by:
      setCalcAutoHeight in class AbstractCellAdv
    • isCalcAutoHeight

      @Internal public boolean isCalcAutoHeight()
      Specified by:
      isCalcAutoHeight in class AbstractCellAdv
    • setTextWidth

      @Internal public void setTextWidth(int widthPx)
      Specified by:
      setTextWidth in class AbstractCellAdv
    • getTextWidth

      @Internal public int getTextWidth()
      Specified by:
      getTextWidth in class AbstractCellAdv
    • getEvalCellValue

      public CellValue getEvalCellValue(boolean evaluatedVal)
      Specified by:
      getEvalCellValue in class AbstractCellAdv
    • 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.