Package io.keikai.api.model
Interface CellData
- All Known Implementing Classes:
CellDataImpl
public interface CellData
This interface provides access to "data" part of a cell including type, text, and value.
- Since:
- 3.0.0
- Author:
- dennis
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionintFor example, a cell displays$123,456.00, but its edit text is123456.The text result after applying the number format, e.g.Gets the cell result type.intgetRow()getType()Gets the cell type.
If the cell is a formula then you are possible getting theCellData.CellType.FORMULAorCellData.CellType.ERROR.
You could usegetResultType()to get result type for a cell or a formula-cell.getValue()booleanisBlank()booleanvoidsetEditText(String editText) Sets the edit text, for example, "123" is number, "2012/1/1" is date, "=SUM(A1:B1)" is formulavoidsetRichText(String html) Sets the rich text in html format.voidSets the data object, it should be a String, Number, Date or BooleanbooleanvalidateEditText(String editText) Validates the edit text if this cell has validation constraint
-
Method Details
-
getRow
int getRow()- Returns:
- 0-based row index
-
getColumn
int getColumn()- Returns:
- 0-based column index
-
getType
CellData.CellType getType()Gets the cell type.
If the cell is a formula then you are possible getting theCellData.CellType.FORMULAorCellData.CellType.ERROR.
You could usegetResultType()to get result type for a cell or a formula-cell.- Returns:
- cell type
-
getResultType
CellData.CellType getResultType()Gets the cell result type.- Returns:
- cell result type
-
getValue
Object getValue()- Returns:
- the cell value, it could be String, Number, or Boolean
-
getDoubleValue
Double getDoubleValue()- Returns:
- the double value of this cell or null if the cell is blank
-
getDateValue
Date getDateValue()- Returns:
- the date data object of this cell or null if the cell is blank
-
getStringValue
String getStringValue()- Returns:
- the string value of this cell or null if the cell is blank
-
getFormulaValue
String getFormulaValue()- Returns:
- the formula string of this cell without leading "=" e.g. SUM(D1:D3)
-
getBooleanValue
Boolean getBooleanValue()- Returns:
- this cell's boolean value or null if the cell is blank
-
getFormatText
String getFormatText()The text result after applying the number format, e.g. a cell has 123456,getFormatText()returns $123,456.00- Returns:
- the formatted text
-
getEditText
String getEditText()For example, a cell displays$123,456.00, but its edit text is123456.- Returns:
- the edit text before applying the format
-
isBlank
boolean isBlank()- Returns:
- true if it is a blank cell
-
isFormula
boolean isFormula()- Returns:
- true if it is a formula cell
-
setValue
Sets the data object, it should be a String, Number, Date or Boolean- Parameters:
value- the data object
-
setEditText
Sets the edit text, for example, "123" is number, "2012/1/1" is date, "=SUM(A1:B1)" is formula- Parameters:
editText-- Throws:
IllegalFormulaException
-
validateEditText
Validates the edit text if this cell has validation constraint- Parameters:
editText- the edit text- Returns:
- false if the editText can't pass the validation
-
setRichText
Sets the rich text in html format.- Since:
- 3.6.0
-
getRichText
String getRichText()- Returns:
- rich text in html format; null if not a rich text.
- Since:
- 3.6.0
-