Package io.keikai.api.model.impl
Class CellDataImpl
- java.lang.Object
-
- io.keikai.api.model.impl.CellDataImpl
-
- All Implemented Interfaces:
CellData
,Serializable
public class CellDataImpl extends Object implements CellData, Serializable
- Since:
- 3.0.0
- Author:
- dennis
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.keikai.api.model.CellData
CellData.CellType
-
-
Constructor Summary
Constructors Constructor Description CellDataImpl(RangeImpl range)
-
Method Summary
All Methods Instance Methods Concrete 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 useCellData.getResultType()
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 htmlString)
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
-
-
-
Constructor Detail
-
CellDataImpl
public CellDataImpl(RangeImpl range)
-
-
Method Detail
-
getColumn
public int getColumn()
-
getResultType
public CellData.CellType getResultType()
Description copied from interface:CellData
Gets the cell result type.- Specified by:
getResultType
in interfaceCellData
- Returns:
- cell result type
-
getType
public CellData.CellType getType()
Description copied from interface:CellData
Gets the cell type.
If the cell is a formula then you are possible getting theCellData.CellType.FORMULA
orCellData.CellType.ERROR
.
You could useCellData.getResultType()
to get result type for a cell or a formula-cell.
-
getValue
public Object getValue()
-
getFormatText
public String getFormatText()
Description copied from interface:CellData
The text result after applying the number format, e.g. a cell has 123456,CellData.getFormatText()
returns $123,456.00- Specified by:
getFormatText
in interfaceCellData
- Returns:
- the formatted text
-
getEditText
public String getEditText()
Description copied from interface:CellData
For example, a cell displays$123,456.00
, but its edit text is123456
.- Specified by:
getEditText
in interfaceCellData
- Returns:
- the edit text before applying the format
-
setValue
public void setValue(Object value)
Description copied from interface:CellData
Sets the data object, it should be a String, Number, Date or Boolean
-
setEditText
public void setEditText(String editText)
Description copied from interface:CellData
Sets the edit text, for example, "123" is number, "2012/1/1" is date, "=SUM(A1:B1)" is formula- Specified by:
setEditText
in interfaceCellData
-
validateEditText
public boolean validateEditText(String editText)
Description copied from interface:CellData
Validates the edit text if this cell has validation constraint- Specified by:
validateEditText
in interfaceCellData
- Parameters:
editText
- the edit text- Returns:
- false if the editText can't pass the validation
-
isBlank
public boolean isBlank()
-
isFormula
public boolean isFormula()
-
getDoubleValue
public Double getDoubleValue()
- Specified by:
getDoubleValue
in interfaceCellData
- Returns:
- the double value of this cell or null if the cell is blank
-
getDateValue
public Date getDateValue()
- Specified by:
getDateValue
in interfaceCellData
- Returns:
- the date data object of this cell or null if the cell is blank
-
getStringValue
public String getStringValue()
- Specified by:
getStringValue
in interfaceCellData
- Returns:
- the string value of this cell or null if the cell is blank
-
getFormulaValue
public String getFormulaValue()
- Specified by:
getFormulaValue
in interfaceCellData
- Returns:
- the formula string of this cell without leading "=" e.g. SUM(D1:D3)
-
getBooleanValue
public Boolean getBooleanValue()
- Specified by:
getBooleanValue
in interfaceCellData
- Returns:
- this cell's boolean value or null if the cell is blank
-
setRichText
public void setRichText(String htmlString)
Description copied from interface:CellData
Sets the rich text in html format.- Specified by:
setRichText
in interfaceCellData
-
getRichText
public String getRichText()
- Specified by:
getRichText
in interfaceCellData
- Returns:
- rich text in html format; null if not a rich text.
-
-