Class CellError

java.lang.Object
com.codename1.spreadsheet.CellError

public final class CellError extends Object

An error a cell holds instead of a value, such as #DIV/0!. A formula that reads a cell in error answers that error, which is how errors travel through a sheet; nothing is thrown.

There is one instance per error, so two errors can be compared with ==.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final CellError
    A formula that depends on its own result.
    static final CellError
    Division by zero.
    static final CellError
    A value that is not available, what a failed lookup answers.
    static final CellError
    A name or a function that is not known.
    static final CellError
    Two ranges that were expected to intersect and do not.
    static final CellError
    A number that is out of the range a function accepts or can answer.
    static final CellError
    A reference to cells that no longer exist.
    static final CellError
    A value of the wrong type, such as text where a number is needed.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    The number the ERROR.TYPE function answers for this error.
    The text a spreadsheet shows for this error.
    static CellError
    The error for the text a spreadsheet shows, ignoring case.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • DIV0

      public static final CellError DIV0
      Division by zero.
    • NA

      public static final CellError NA
      A value that is not available, what a failed lookup answers.
    • NAME

      public static final CellError NAME
      A name or a function that is not known.
    • NULL

      public static final CellError NULL
      Two ranges that were expected to intersect and do not.
    • NUM

      public static final CellError NUM
      A number that is out of the range a function accepts or can answer.
    • REF

      public static final CellError REF
      A reference to cells that no longer exist.
    • VALUE

      public static final CellError VALUE
      A value of the wrong type, such as text where a number is needed.
    • CIRCULAR

      public static final CellError CIRCULAR
      A formula that depends on its own result. Spreadsheet files have no such value: XLSX writes it as #REF!, OpenDocument as LibreOffice's Err:522, and CSV as #CIRC!.
  • Method Details

    • valueOf

      public static CellError valueOf(String text)

      The error for the text a spreadsheet shows, ignoring case.

      Parameters
      • text: text such as #N/A
      Returns

      the error, or null when the text is not one

    • getType

      public int getType()

      The number the ERROR.TYPE function answers for this error.

      Returns

      a number from 1 to 7

    • toString

      public String toString()

      The text a spreadsheet shows for this error.

      Returns

      text such as #DIV/0!

      Overrides:
      toString in class Object