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 BooleangetBooleanValue()intgetColumn()DategetDateValue()DoublegetDoubleValue()StringgetEditText()For example, a cell displays$123,456.00, but its edit text is123456.StringgetFormatText()The text result after applying the number format, e.g.StringgetFormulaValue()CellData.CellTypegetResultType()Gets the cell result type.StringgetRichText()intgetRow()StringgetStringValue()CellData.CellTypegetType()Gets the cell type.
If the cell is a formula then you are possible getting theCellData.CellType.FORMULAorCellData.CellType.ERROR.
You could useCellData.getResultType()to get result type for a cell or a formula-cell.ObjectgetValue()booleanisBlank()booleanisFormula()voidsetEditText(String editText)Sets the edit text, for example, "123" is number, "2012/1/1" is date, "=SUM(A1:B1)" is formulavoidsetRichText(String htmlString)Sets the rich text in html format.voidsetValue(Object value)Sets the data object, it should be a String, Number, Date or BooleanbooleanvalidateEditText(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:CellDataGets the cell result type.- Specified by:
getResultTypein interfaceCellData- Returns:
- cell result type
-
getType
public CellData.CellType getType()
Description copied from interface:CellDataGets the cell type.
If the cell is a formula then you are possible getting theCellData.CellType.FORMULAorCellData.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:CellDataThe text result after applying the number format, e.g. a cell has 123456,CellData.getFormatText()returns $123,456.00- Specified by:
getFormatTextin interfaceCellData- Returns:
- the formatted text
-
getEditText
public String getEditText()
Description copied from interface:CellDataFor example, a cell displays$123,456.00, but its edit text is123456.- Specified by:
getEditTextin interfaceCellData- Returns:
- the edit text before applying the format
-
setValue
public void setValue(Object value)
Description copied from interface:CellDataSets the data object, it should be a String, Number, Date or Boolean
-
setEditText
public void setEditText(String editText)
Description copied from interface:CellDataSets the edit text, for example, "123" is number, "2012/1/1" is date, "=SUM(A1:B1)" is formula- Specified by:
setEditTextin interfaceCellData
-
validateEditText
public boolean validateEditText(String editText)
Description copied from interface:CellDataValidates the edit text if this cell has validation constraint- Specified by:
validateEditTextin 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:
getDoubleValuein interfaceCellData- Returns:
- the double value of this cell or null if the cell is blank
-
getDateValue
public Date getDateValue()
- Specified by:
getDateValuein interfaceCellData- Returns:
- the date data object of this cell or null if the cell is blank
-
getStringValue
public String getStringValue()
- Specified by:
getStringValuein interfaceCellData- Returns:
- the string value of this cell or null if the cell is blank
-
getFormulaValue
public String getFormulaValue()
- Specified by:
getFormulaValuein interfaceCellData- Returns:
- the formula string of this cell without leading "=" e.g. SUM(D1:D3)
-
getBooleanValue
public Boolean getBooleanValue()
- Specified by:
getBooleanValuein interfaceCellData- Returns:
- this cell's boolean value or null if the cell is blank
-
setRichText
public void setRichText(String htmlString)
Description copied from interface:CellDataSets the rich text in html format.- Specified by:
setRichTextin interfaceCellData
-
getRichText
public String getRichText()
- Specified by:
getRichTextin interfaceCellData- Returns:
- rich text in html format; null if not a rich text.
-
-