Package io.keikai.axyra.sheets
Class Cell
java.lang.Object
io.keikai.axyra.sheets.Cell
-
Method Summary
Modifier and TypeMethodDescriptionaddThreadedComment(String author, String text) Start a new comment thread on this cell; returns the generated comment id (a braced GUID).addThreadedReply(String parentId, String author, String text) Reply to the thread containingparentId(a root or reply id; replies attach to the thread root, like Excel).voidclear()Clear the cell (value and formula).intcol()0-based column.comment()The cell's comment, ornull.The comment's rich-text runs — empty for a plain-text note, null when the cell has no comment.The cell's value interpreted as a date-time (day fraction rounded to seconds), or null when the cell is not numeric.The cell's value interpreted as a date (the serial's day part under the workbook's date system), or null when the cell is not numeric.The cell's display text: its value rendered through the cell style's number format under the workbook display locale (Workbook.setLocale(java.lang.String); default en-US).formula()The cell's formula source, ornullif it is not a formula cell.formulaLocalized(String locale) The cell's formula rendered inlocale's display form (translated function names +;separator), ornullfor a non-formula cell.The cell's hyperlink, ornull.voidRemove any comment.voidRemove any hyperlink.booleanRemove the comment withid— a root id removes its whole thread, a reply id removes just that reply.intNumber of rich-text runs on this cell (0 if it is not rich text).richText()The cell's rich (multi-run) text with per-run formatting, ornullif the cell is not rich text.introw()0-based row.voidsetComment(Comment comment) voidsetComment(String author, String text) Attach or replace the cell's comment.booleansetCommentLayout(double widthPt, double heightPt, boolean visible) Set the note-shape layout of this cell's existing comment: box size in points and whether the note stays visible without hovering (Excel's "Show Comment").voidSets a date: the value becomes the Excel serial fordate(honoring the workbook's 1900/1904 date system), and ayyyy-mm-ddnumber format is applied when the cell still hasGeneral(an existing format is kept).voidsetDateTime(LocalDateTime dateTime) Sets a date-time: the serial carries the day fraction (second precision) and ayyyy-mm-dd hh:mm:ssformat is applied when the cell still hasGeneral.voidsetFormula(String formula) Set the cell's formula (empty string clears it).voidsetFormulaLocalized(String formula, String locale) Set the cell's formula written in a locale's display form — translated function names (e.g.voidsetHyperlink(Hyperlink link) Attach or replace the cell's hyperlink.voidsetHyperlink(String url) Attach or replace a URL hyperlink.voidsetRichComment(String author, CommentRun... runs) Attach or replace a RICH-TEXT comment (note): eachCommentRuncarries per-run font overrides (ECMA-376 Part 1 §18.7.7).voidsetRichText(RichText richText) Set this cell to rich (multi-run) formatted text.voidApply a style to this cell (the engine dedups identical styles).booleansetThreadedCommentResolved(String id, boolean resolved) Resolve / reopen the thread containingid; returns whether it matched a comment on this sheet.voidSet the cell's value, clearing any formula.style()The cell's resolved style.This cell's comment threads: each rootThreadedCommentcarries its replies.value()The cell's value (formula cells return their evaluated value).
-
Method Details
-
row
public int row()0-based row. -
col
public int col()0-based column. -
value
The cell's value (formula cells return their evaluated value). -
formattedText
The cell's display text: its value rendered through the cell style's number format under the workbook display locale (Workbook.setLocale(java.lang.String); default en-US). Blank cells return an empty string. -
setValue
Set the cell's value, clearing any formula. -
setDate
Sets a date: the value becomes the Excel serial fordate(honoring the workbook's 1900/1904 date system), and ayyyy-mm-ddnumber format is applied when the cell still hasGeneral(an existing format is kept). Dates before March 1900 use the standard serial formula and thus differ from Excel's historical leap-year bug by one day. -
setDateTime
Sets a date-time: the serial carries the day fraction (second precision) and ayyyy-mm-dd hh:mm:ssformat is applied when the cell still hasGeneral. -
dateValue
The cell's value interpreted as a date (the serial's day part under the workbook's date system), or null when the cell is not numeric. -
dateTimeValue
The cell's value interpreted as a date-time (day fraction rounded to seconds), or null when the cell is not numeric. -
formula
The cell's formula source, ornullif it is not a formula cell. -
setFormula
Set the cell's formula (empty string clears it). -
setFormulaLocalized
Set the cell's formula written in a locale's display form — translated function names (e.g. GermanSUMME, FrenchSOMME) and the;argument separator. It is translated to the en-US canonical form (English names,,separator) before storage.localeis a language tag such as"de"or"fr-FR"; an unknown locale stores the formula unchanged. Function names inside string literals are never translated. -
formulaLocalized
The cell's formula rendered inlocale's display form (translated function names +;separator), ornullfor a non-formula cell. The inverse ofsetFormulaLocalized(java.lang.String, java.lang.String). -
clear
public void clear()Clear the cell (value and formula). -
setRichText
Set this cell to rich (multi-run) formatted text. -
richText
The cell's rich (multi-run) text with per-run formatting, ornullif the cell is not rich text. The returned value feeds straight back intosetRichText(io.keikai.axyra.sheets.content.RichText)(round-trip safe). -
richRunCount
public int richRunCount()Number of rich-text runs on this cell (0 if it is not rich text). -
style
The cell's resolved style. -
setStyle
Apply a style to this cell (the engine dedups identical styles). -
comment
The cell's comment, ornull. -
setComment
Attach or replace the cell's comment. -
setCommentLayout
public boolean setCommentLayout(double widthPt, double heightPt, boolean visible) Set the note-shape layout of this cell's existing comment: box size in points and whether the note stays visible without hovering (Excel's "Show Comment"). Returns whether a comment was present. Imported note geometry is regenerated from these values on the next save. -
setComment
-
setRichComment
Attach or replace a RICH-TEXT comment (note): eachCommentRuncarries per-run font overrides (ECMA-376 Part 1 §18.7.7). The comment's plainComment.text()becomes the concatenation of the run texts.- Throws:
AxyraException- when no runs are given or a run has empty text
-
commentRuns
The comment's rich-text runs — empty for a plain-text note, null when the cell has no comment. -
removeComment
public void removeComment()Remove any comment. -
threadedComments
This cell's comment threads: each rootThreadedCommentcarries its replies. Empty when the cell has none. -
addThreadedComment
Start a new comment thread on this cell; returns the generated comment id (a braced GUID). The author is registered in the workbook persons list when new. -
addThreadedReply
Reply to the thread containingparentId(a root or reply id; replies attach to the thread root, like Excel). Returns the new reply id, ornullwhen the parent does not exist. -
setThreadedCommentResolved
Resolve / reopen the thread containingid; returns whether it matched a comment on this sheet. -
removeThreadedComment
Remove the comment withid— a root id removes its whole thread, a reply id removes just that reply. Returns whether anything was removed. -
hyperlink
The cell's hyperlink, ornull. -
setHyperlink
Attach or replace a URL hyperlink. -
setHyperlink
Attach or replace the cell's hyperlink. -
removeHyperlink
public void removeHyperlink()Remove any hyperlink.
-