Class CellDataImpl

    • 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 Object getValue()
        Specified by:
        getValue in interface CellData
        Returns:
        the cell value, it could be String, Number, or Boolean
      • 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.