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:
  • Constructor Details

    • CellDataImpl

      public CellDataImpl(RangeImpl range)
  • Method Details

    • getRow

      public int getRow()
      Specified by:
      getRow in interface CellData
      Returns:
      0-based row index
    • getColumn

      public int getColumn()
      Specified by:
      getColumn in interface CellData
      Returns:
      0-based column index
    • getResultType

      public CellData.CellType getResultType()
      Description copied from interface: CellData
      Gets the cell result type.
      Specified by:
      getResultType in interface CellData
      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 the CellData.CellType.FORMULA or CellData.CellType.ERROR.
      You could use CellData.getResultType() to get result type for a cell or a formula-cell.
      Specified by:
      getType in interface CellData
      Returns:
      cell type
    • getValue

      public Object getValue()
      Specified by:
      getValue in interface CellData
      Returns:
      the cell value, it could be String, Number, or Boolean
    • 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 interface CellData
      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 is 123456.
      Specified by:
      getEditText in interface CellData
      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
      Specified by:
      setValue in interface CellData
      Parameters:
      value - the data object
    • 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 interface CellData
    • 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 interface CellData
      Parameters:
      editText - the edit text
      Returns:
      false if the editText can't pass the validation
    • isBlank

      public boolean isBlank()
      Specified by:
      isBlank in interface CellData
      Returns:
      true if it is a blank cell
    • isFormula

      public boolean isFormula()
      Specified by:
      isFormula in interface CellData
      Returns:
      true if it is a formula cell
    • getDoubleValue

      public Double getDoubleValue()
      Specified by:
      getDoubleValue in interface CellData
      Returns:
      the double value of this cell or null if the cell is blank
    • getDateValue

      public Date getDateValue()
      Specified by:
      getDateValue in interface CellData
      Returns:
      the date data object of this cell or null if the cell is blank
    • getStringValue

      public String getStringValue()
      Specified by:
      getStringValue in interface CellData
      Returns:
      the string value of this cell or null if the cell is blank
    • getFormulaValue

      public String getFormulaValue()
      Specified by:
      getFormulaValue in interface CellData
      Returns:
      the formula string of this cell without leading "=" e.g. SUM(D1:D3)
    • getBooleanValue

      public Boolean getBooleanValue()
      Specified by:
      getBooleanValue in interface CellData
      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 interface CellData
    • getRichText

      public String getRichText()
      Specified by:
      getRichText in interface CellData
      Returns:
      rich text in html format; null if not a rich text.