Class 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
    • Constructor Detail

      • CellDataImpl

        public CellDataImpl​(RangeImpl range)
    • Method Detail

      • 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
      • getValue

        public java.lang.Object getValue()
        Specified by:
        getValue in interface CellData
        Returns:
        the cell value, it could be String, Number, or Boolean
      • getFormatText

        public java.lang.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 java.lang.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​(java.lang.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​(java.lang.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​(java.lang.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 java.lang.Double getDoubleValue()
        Specified by:
        getDoubleValue in interface CellData
        Returns:
        the double value of this cell or null if the cell is blank
      • getDateValue

        public java.util.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 java.lang.String getStringValue()
        Specified by:
        getStringValue in interface CellData
        Returns:
        the string value of this cell or null if the cell is blank
      • getFormulaValue

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

        public java.lang.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​(java.lang.String htmlString)
        Description copied from interface: CellData
        Sets the rich text in html format.
        Specified by:
        setRichText in interface CellData
      • getRichText

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