Interface SCell

All Superinterfaces:
CellStyleHolder, FormulaContent
All Known Implementing Classes:
AbstractCellAdv

public interface SCell extends CellStyleHolder, FormulaContent
Represent a cell of a sheet in a Spreadsheet. A cell contains value and style (SCellStyle), and its type is one of SCell.CellType.
Since:
3.5.0
Author:
dennis
  • Method Details

    • getSheet

      SSheet getSheet()
    • getFormulaResultType

      SCell.CellType getFormulaResultType()
    • getType

      SCell.CellType getType()
      Returns:
      the cell type
    • getValue

      Object getValue()
      Returns:
      cell value.
    • setValue

      void setValue(Object value)
    • isNull

      boolean isNull()
      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

      int getRowIndex()
    • getColumnIndex

      int getColumnIndex()
    • getReferenceString

      String getReferenceString()
      Returns:
      cell reference like A1
    • getHyperlink

      SHyperlink getHyperlink()
    • setHyperlink

      void setHyperlink(SHyperlink hyperlink)
      Set or clear a hyperlink
      Parameters:
      hyperlink - hyperlink to set, or null to clear
    • setupHyperlink

      SHyperlink setupHyperlink(SHyperlink.HyperlinkType type, String address, String label)
      setup a hyperlink
    • clearValue

      void clearValue()
      clear cell value , reset it to blank
    • setStringValue

      void setStringValue(String value)
      Set string value, if the value start with '=', then it sets as formula
    • getStringValue

      String getStringValue()
    • setupRichTextValue

      SRichText setupRichTextValue()
      Setup a rich text value(Create a new one if the old value is not a rich-text) and return the instance which to be edited.
    • getRichTextValue

      SRichText getRichTextValue()
      Return the rich text value. if this cell is a simple string value, it will return a read-only rich-text which wraps string-value and current font.
      Returns:
    • isRichTextValue

      boolean isRichTextValue()
      Check if this cell contains a rich-text value
    • setFormulaValue

      void setFormulaValue(String formula)
      set formula with string without '=', e.g. SUM(A1:B2)
      Parameters:
      formula -
    • getFormulaValue

      String getFormulaValue()
      Returns:
      returns formula string without '=', e.g. SUM(A1:B2)
    • getFormulaEditValue

      default String getFormulaEditValue()
      Returns the formula formatted for the user-visible edit text / formula bar (BOR-FM-003 R9): OOXML-internal _xlfn./_xlfn._xlws./ _xlpm. prefixes are stripped, unlike getFormulaValue() which stays raw for OOXML round-trip fidelity. The default returns getFormulaValue() unchanged; engine-backed cells override this.
      Returns:
      the edit-text form of the formula (without leading '=')
    • setNumberValue

      void setNumberValue(Double number)
    • getNumberValue

      Double getNumberValue()
    • setDateValue

      void setDateValue(Date date)
      Sets the number value a date instance, it will transfer the date to double value
    • getDateValue

      Date getDateValue()
      Gets the date value that is transfered by the double number value.
    • setBooleanValue

      void setBooleanValue(Boolean bool)
    • getBooleanValue

      Boolean getBooleanValue()
      Gets the boolean value
    • getErrorValue

      ErrorValue getErrorValue()
    • setErrorValue

      void setErrorValue(ErrorValue errorValue)
    • setComment

      void setComment(SComment comment)
    • setupComment

      SComment setupComment()
    • getComment

      SComment getComment()
    • deleteComment

      void deleteComment()
      Delete the comment associated with this cell.
      Since:
      3.7.0
    • getArrayFormulaRegion

      @Deprecated CellRegion getArrayFormulaRegion()
      Deprecated.
      since 7.0.0 — the name is ambiguous between CSE and DA. Use getCseRegion() for the CSE-only lookup, or getArrayRegion() for the unified (CSE + DA) lookup.
      Returns the region of the legacy CSE array group that this cell belongs to, or null if the cell is not in a CSE region.

      CSE-only semantic. Does NOT report dynamic-array (DA) spill regions.

      Returns:
      the CSE region or null.
      Since:
      6.0.0
    • isPartOfArrayFormulaGroup

      @Deprecated boolean isPartOfArrayFormulaGroup()
      Deprecated.
      since 7.0.0 — the name is ambiguous between CSE and DA. Use isCseMember() for the CSE-only predicate, or isInArrayRegion() for the unified (CSE + DA) predicate.
      Returns true if this cell is part of a legacy CSE array group.

      CSE-only semantic. Does NOT return true for cells in dynamic-array spills.

      Returns:
      true if the cell is a member of a CSE array.
      Since:
      6.0.0
    • isInArrayRegion

      default boolean isInArrayRegion()
      Returns true if this cell is in any array region — either a legacy CSE array OR a dynamic-array spill (anchor or ghost).
      Since:
      7.0.0
    • getArrayRegion

      default CellRegion getArrayRegion()
      Returns the full region of any array group containing this cell — either a legacy CSE array OR a dynamic-array spill — or null if the cell is not in any array.
      Since:
      7.0.0
    • isDaSpillGhost

      default boolean isDaSpillGhost()
      Returns true if this cell is a dynamic-array spill GHOST (i.e., its value was projected from the spill anchor; the anchor cell itself returns false).
      Since:
      7.0.0
    • isCseMember

      default boolean isCseMember()
      Returns true if this cell is a member of a legacy CSE array region. Excludes dynamic-array spills.
      Since:
      7.0.0
    • getCseRegion

      default CellRegion getCseRegion()
      Returns the legacy CSE array region containing this cell, or null if the cell is not in a CSE region. Does NOT report dynamic-array spills.
      Since:
      7.0.0
    • isDaSpillAnchor

      default boolean isDaSpillAnchor()
      Returns true if this cell is the ANCHOR of a dynamic-array spill (the cell that owns the formula and produces the spilled array). Ghost cells return false.
      Since:
      7.0.0
    • isInDaSpill

      default boolean isInDaSpill()
      Returns true if this cell is in any dynamic-array spill — either the anchor OR a ghost. Convenience for isDaSpillAnchor() || isDaSpillGhost().
      Since:
      7.0.0