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
    • Method Detail

      • getRow

        int getRow()
        Returns:
        0-based row index
      • getColumn

        int getColumn()
        Returns:
        0-based column index
      • 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 is 123456.
        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