Holger's Java API

## com.antelmann.ooffice
Enum Cell.Format

    java.lang.Object
      java.lang.Enum<Cell.Format>
          com.antelmann.ooffice.Cell.Format

All Implemented Interfaces:
  Serializable, Comparable<Cell.Format>

Enclosing class:
  Cell

    public static enum Cell.Format

extends Enum<Cell.Format>

used to format a cell value in `OOCalc`

Enum Constant Summary
`ALL`
`CURRENCY`
`DATE`
`DATETIME`
`DEFINED`
`FRACTION`
`LOGICAL`
`NUMBER`
`PERCENT`
`SCIENTIFIC`
`TEXT`
`TIME`
`UNDEFINED`

Field Summary
`static String` `NUMBER_FORMAT_KEY`

Method Summary
`static void` `applyFormat(OOCalc calc, Object cellOrRange, int formatNumber)`
`void` `applyTo(OOCalc calc, Object cellOrRange)`
`void` `applyTo(OOCalc calc, Object cellOrRange, Locale locale)` works for `XCell` or `XCellRange` objects
`static Cell.Format` `fromInt(int n)`
`static int` `getNumberFormat(OOCalc calc, String numberFormatString)`
`static int` `getNumberFormat(OOCalc calc, String numberFormatString, Locale locale)`
`short` `getShortValue()`
`static Cell.Format` `valueOf(String name)` Returns the enum constant of this type with the specified name.
`static Cell.Format[]` `values()` Returns an array containing the constants of this enum type, in the order they are declared.

Methods inherited from class java.lang.Enum
`clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

Methods inherited from class java.lang.Object
`getClass, notify, notifyAll, wait, wait, wait`

Enum Constant Detail

### ALL

    public static final Cell.Format ALL

### CURRENCY

    public static final Cell.Format CURRENCY

### DATE

    public static final Cell.Format DATE

### DATETIME

    public static final Cell.Format DATETIME

### DEFINED

    public static final Cell.Format DEFINED

### FRACTION

    public static final Cell.Format FRACTION

### LOGICAL

    public static final Cell.Format LOGICAL

### NUMBER

    public static final Cell.Format NUMBER

### PERCENT

    public static final Cell.Format PERCENT

### SCIENTIFIC

    public static final Cell.Format SCIENTIFIC

### TEXT

    public static final Cell.Format TEXT

### TIME

    public static final Cell.Format TIME

### UNDEFINED

    public static final Cell.Format UNDEFINED

Field Detail

### NUMBER_FORMAT_KEY

    public static final String NUMBER_FORMAT_KEY

See Also:
  `getNumberFormat(OOCalc, String)`, `OfficeUtils.setXPropertyValue(Object, String, Object)`, Constant Field Values

Method Detail

### values

    public static Cell.Format[] values()

  Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:

      for (Cell.Format c : Cell.Format.values())
          System.out.println(c);

  Returns:
    an array containing the constants of this enum type, in the order they are declared

### valueOf

    public static Cell.Format valueOf(String name)

  Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

  Parameters:
    `name` - the name of the enum constant to be returned.
  Returns:
    the enum constant with the specified name
  Throws:
    `IllegalArgumentException` - if this enum type has no constant with the specified name
    `NullPointerException` - if the argument is null

### getShortValue

    public short getShortValue()

### fromInt

    public static Cell.Format fromInt(int n)

### applyTo

    public void applyTo(OOCalc calc,
                        Object cellOrRange)
                 throws IllegalArgumentException,
                        OfficeException

  Throws:
    `IllegalArgumentException`
    `OfficeException`

### applyTo

    public void applyTo(OOCalc calc,
                        Object cellOrRange,
                        Locale locale)
                 throws IllegalArgumentException,
                        OfficeException

  works for `XCell` or `XCellRange` objects

  Throws:
    `IllegalArgumentException`
    `OfficeException`

### applyFormat

    public static void applyFormat(OOCalc calc,
                                   Object cellOrRange,
                                   int formatNumber)
                            throws IllegalArgumentException,
                                   OfficeException

  Throws:
    `IllegalArgumentException`
    `OfficeException`
  See Also:
    `getNumberFormat(OOCalc, String, Locale)`

### getNumberFormat

    public static int getNumberFormat(OOCalc calc,
                                      String numberFormatString)

  See Also:
    `NUMBER_FORMAT_KEY`, `OfficeUtils.setXPropertyValue(Object, String, Object)`

### getNumberFormat

    public static int getNumberFormat(OOCalc calc,
                                      String numberFormatString,
                                      Locale locale)

(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads