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 Modifier and Type Interface Description static class
CellData.CellType
The cell type
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Boolean
getBooleanValue()
int
getColumn()
Date
getDateValue()
Double
getDoubleValue()
String
getEditText()
For example, a cell displays$123,456.00
, but its edit text is123456
.String
getFormatText()
The text result after applying the number format, e.g.String
getFormulaValue()
CellData.CellType
getResultType()
Gets the cell result type.String
getRichText()
int
getRow()
String
getStringValue()
CellData.CellType
getType()
Gets the cell type.
If the cell is a formula then you are possible getting theCellData.CellType.FORMULA
orCellData.CellType.ERROR
.
You could usegetResultType()
to get result type for a cell or a formula-cell.Object
getValue()
boolean
isBlank()
boolean
isFormula()
void
setEditText(String editText)
Sets the edit text, for example, "123" is number, "2012/1/1" is date, "=SUM(A1:B1)" is formulavoid
setRichText(String html)
Sets the rich text in html format.void
setValue(Object value)
Sets the data object, it should be a String, Number, Date or Booleanboolean
validateEditText(String editText)
Validates the edit text if this cell has validation constraint
-
-
-
Method Detail
-
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.FORMULA
orCellData.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
void setValue(Object value)
Sets the data object, it should be a String, Number, Date or Boolean- Parameters:
value
- the data object
-
setEditText
void setEditText(String editText)
Sets the edit text, for example, "123" is number, "2012/1/1" is date, "=SUM(A1:B1)" is formula- Parameters:
editText
-- Throws:
IllegalFormulaException
-
validateEditText
boolean validateEditText(String editText)
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
void setRichText(String html)
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
-
-