Package io.keikai.model
Interface SCell
- All Superinterfaces:
CellStyleHolder,FormulaContent
- All Known Implementing Classes:
AbstractCellAdv
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
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionvoidclear cell value , reset it to blankvoidDelete the comment associated with this cell.Deprecated.since 7.0.0 — the name is ambiguous between CSE and DA.default CellRegionReturns the full region of any array group containing this cell — either a legacy CSE array OR a dynamic-array spill — ornullif the cell is not in any array.Gets the boolean valueintdefault CellRegionReturns the legacy CSE array region containing this cell, ornullif the cell is not in a CSE region.Gets the date value that is transfered by the double number value.default StringReturns the formula formatted for the user-visible edit text / formula bar (BOR-FM-003 R9): OOXML-internal_xlfn./_xlfn._xlws./_xlpm.prefixes are stripped, unlikegetFormulaValue()which stays raw for OOXML round-trip fidelity.Return the rich text value.intgetSheet()getType()getValue()default booleanReturnstrueif this cell is a member of a legacy CSE array region.default booleanReturnstrueif this cell is the ANCHOR of a dynamic-array spill (the cell that owns the formula and produces the spilled array).default booleanReturnstrueif this cell is a dynamic-array spill GHOST (i.e., its value was projected from the spill anchor; the anchor cell itself returnsfalse).default booleanReturnstrueif this cell is in any array region — either a legacy CSE array OR a dynamic-array spill (anchor or ghost).default booleanReturnstrueif this cell is in any dynamic-array spill — either the anchor OR a ghost.booleanisNull()Because you always get a not-null cell object, use this method to judge the cell is really null or not.booleanDeprecated.since 7.0.0 — the name is ambiguous between CSE and DA.booleanCheck if this cell contains a rich-text valuevoidsetBooleanValue(Boolean bool) voidsetComment(SComment comment) voidsetDateValue(Date date) Sets the number value a date instance, it will transfer the date to double valuevoidsetErrorValue(ErrorValue errorValue) voidsetFormulaValue(String formula) set formula with string without '=', e.g.voidsetHyperlink(SHyperlink hyperlink) Set or clear a hyperlinkvoidsetNumberValue(Double number) voidsetStringValue(String value) Set string value, if the value start with '=', then it sets as formulasetupHyperlink(SHyperlink.HyperlinkType type, String address, String label) setup a hyperlinkSetup 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.voidMethods inherited from interface io.keikai.model.CellStyleHolder
getCellStyle, getCellStyle, setCellStyleMethods inherited from interface io.keikai.model.FormulaContent
clearFormulaResultCache, isFormulaParsingError
-
Method Details
-
getSheet
SSheet getSheet() -
getFormulaResultType
SCell.CellType getFormulaResultType() -
getType
SCell.CellType getType()- Returns:
- the cell type
-
getValue
Object getValue()- Returns:
- cell value.
-
setValue
-
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
Set or clear a hyperlink- Parameters:
hyperlink- hyperlink to set, or null to clear
-
setupHyperlink
setup a hyperlink -
clearValue
void clearValue()clear cell value , reset it to blank -
setStringValue
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
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
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, unlikegetFormulaValue()which stays raw for OOXML round-trip fidelity. The default returnsgetFormulaValue()unchanged; engine-backed cells override this.- Returns:
- the edit-text form of the formula (without leading '=')
-
setNumberValue
-
getNumberValue
Double getNumberValue() -
setDateValue
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
-
getBooleanValue
Boolean getBooleanValue()Gets the boolean value -
getErrorValue
ErrorValue getErrorValue() -
setErrorValue
-
setComment
-
setupComment
SComment setupComment() -
getComment
SComment getComment() -
deleteComment
void deleteComment()Delete the comment associated with this cell.- Since:
- 3.7.0
-
getArrayFormulaRegion
Deprecated.since 7.0.0 — the name is ambiguous between CSE and DA. UsegetCseRegion()for the CSE-only lookup, orgetArrayRegion()for the unified (CSE + DA) lookup.Returns the region of the legacy CSE array group that this cell belongs to, ornullif 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.since 7.0.0 — the name is ambiguous between CSE and DA. UseisCseMember()for the CSE-only predicate, orisInArrayRegion()for the unified (CSE + DA) predicate.Returnstrueif this cell is part of a legacy CSE array group.CSE-only semantic. Does NOT return
truefor cells in dynamic-array spills.- Returns:
trueif the cell is a member of a CSE array.- Since:
- 6.0.0
-
isInArrayRegion
default boolean isInArrayRegion()Returnstrueif 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
Returns the full region of any array group containing this cell — either a legacy CSE array OR a dynamic-array spill — ornullif the cell is not in any array.- Since:
- 7.0.0
-
isDaSpillGhost
default boolean isDaSpillGhost()Returnstrueif this cell is a dynamic-array spill GHOST (i.e., its value was projected from the spill anchor; the anchor cell itself returnsfalse).- Since:
- 7.0.0
-
isCseMember
default boolean isCseMember()Returnstrueif this cell is a member of a legacy CSE array region. Excludes dynamic-array spills.- Since:
- 7.0.0
-
getCseRegion
Returns the legacy CSE array region containing this cell, ornullif the cell is not in a CSE region. Does NOT report dynamic-array spills.- Since:
- 7.0.0
-
isDaSpillAnchor
default boolean isDaSpillAnchor()Returnstrueif this cell is the ANCHOR of a dynamic-array spill (the cell that owns the formula and produces the spilled array). Ghost cells returnfalse.- Since:
- 7.0.0
-
isInDaSpill
default boolean isInDaSpill()Returnstrueif this cell is in any dynamic-array spill — either the anchor OR a ghost. Convenience forisDaSpillAnchor() || isDaSpillGhost().- Since:
- 7.0.0
-