Package io.keikai.api.model.impl
Class CellDataImpl
- java.lang.Object
-
- io.keikai.api.model.impl.CellDataImpl
-
- All Implemented Interfaces:
CellData,java.io.Serializable
public class CellDataImpl extends java.lang.Object implements CellData, java.io.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 java.lang.BooleangetBooleanValue()intgetColumn()java.util.DategetDateValue()java.lang.DoublegetDoubleValue()java.lang.StringgetEditText()For example, a cell displays$123,456.00, but its edit text is123456.java.lang.StringgetFormatText()The text result after applying the number format, e.g. a cell has 123456,CellData.getFormatText()returns $123,456.00java.lang.StringgetFormulaValue()CellData.CellTypegetResultType()Gets the cell result type.java.lang.StringgetRichText()intgetRow()java.lang.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.java.lang.ObjectgetValue()booleanisBlank()booleanisFormula()voidsetEditText(java.lang.String editText)Sets the edit text, for example, "123" is number, "2012/1/1" is date, "=SUM(A1:B1)" is formulavoidsetRichText(java.lang.String htmlString)Sets the rich text in html format.voidsetValue(java.lang.Object value)Sets the data object, it should be a String, Number, Date or BooleanbooleanvalidateEditText(java.lang.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 java.lang.Object getValue()
-
getFormatText
public java.lang.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 java.lang.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(java.lang.Object value)
Description copied from interface:CellDataSets the data object, it should be a String, Number, Date or Boolean
-
setEditText
public void setEditText(java.lang.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(java.lang.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 java.lang.Double getDoubleValue()
- Specified by:
getDoubleValuein interfaceCellData- Returns:
- the double value of this cell or null if the cell is blank
-
getDateValue
public java.util.Date getDateValue()
- Specified by:
getDateValuein interfaceCellData- Returns:
- the date data object of this cell or null if the cell is blank
-
getStringValue
public java.lang.String getStringValue()
- Specified by:
getStringValuein interfaceCellData- Returns:
- the string value of this cell or null if the cell is blank
-
getFormulaValue
public java.lang.String getFormulaValue()
- Specified by:
getFormulaValuein interfaceCellData- Returns:
- the formula string of this cell without leading "=" e.g. SUM(D1:D3)
-
getBooleanValue
public java.lang.Boolean getBooleanValue()
- Specified by:
getBooleanValuein interfaceCellData- Returns:
- this cell's boolean value or null if the cell is blank
-
setRichText
public void setRichText(java.lang.String htmlString)
Description copied from interface:CellDataSets the rich text in html format.- Specified by:
setRichTextin interfaceCellData
-
getRichText
public java.lang.String getRichText()
- Specified by:
getRichTextin interfaceCellData- Returns:
- rich text in html format; null if not a rich text.
-
-