Overview | Package | Class | Tree | Deprecated | Index | Help
| ContactCenters V. 0.9.9.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## umontreal.iro.lecuyer.util
Class LaTeXDoubleFormatterWithError

    java.lang.Object
      umontreal.iro.lecuyer.util.LaTeXDoubleFormatterWithError

All Implemented Interfaces:
  DoubleFormatter, DoubleFormatterWithError

    public class LaTeXDoubleFormatterWithError

extends Object
implements DoubleFormatterWithError

Represents a double formatter with error formatting strings for insertion into a LATEX document. This formatter uses an ordinary double formatter, and calls `String)` on the returned strings. This method processes strings to be formatted in LATEX, e.g., convert scientific notation.

Constructor Summary
`LaTeXDoubleFormatterWithError(DoubleFormatterWithError df)` Constructs a new double formatter using `df`.
`LaTeXDoubleFormatterWithError(DoubleFormatterWithError df, String ensureMathCmd)` Constructs a new double formatter using `df`, and the LATEX command given by `ensureMathCmd` to ensure math mode when necessary.

Method Summary
`String` | `format(double x)` This should be equivalent to `format (x, 0)`.
`String` | `format(double x, double error)` Formats the value `x` with error `error` into a string, and returns the formatted string.
`DoubleFormatterWithError` | `getDoubleFormatter()` Returns the double formatter used by this formatter.
`String` | `getEnsureMathCommand()` Returns the name of the math-ensuring LATEX command.
`void` | `setDoubleFormatter(DoubleFormatterWithError df)` Sets the double formatter used by this formatter to `df`.
`void` | `setEnsureMathCommand(String ensureMathCmd)` Sets the name of the math-ensuring LATEX command to `ensureMathCmd`.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### LaTeXDoubleFormatterWithError

    public LaTeXDoubleFormatterWithError(DoubleFormatterWithError df)

  Constructs a new double formatter using `df`.

  Parameters:
    `df` - the double formatter being used.

### LaTeXDoubleFormatterWithError

    public LaTeXDoubleFormatterWithError(DoubleFormatterWithError df,
                                         String ensureMathCmd)

  Constructs a new double formatter using `df`, and the LATEX command given by `ensureMathCmd` to ensure math mode when necessary. The default value for `ensureMathCmd` is `ensuremath`.

  Parameters:
    `df` - the double formatter being used.
    `ensureMathCmd` - the name of the ensure-math command.

Method Detail

### getDoubleFormatter

    public DoubleFormatterWithError getDoubleFormatter()

  Returns the double formatter used by this formatter.

  Returns:
    the double formatter being used.

### setDoubleFormatter

    public void setDoubleFormatter(DoubleFormatterWithError df)

  Sets the double formatter used by this formatter to `df`.

  Parameters:
    `df` - the new double formatter.

### getEnsureMathCommand

    public String getEnsureMathCommand()

  Returns the name of the math-ensuring LATEX command.

  Returns:
    the math-ensuring command.

### setEnsureMathCommand

    public void setEnsureMathCommand(String ensureMathCmd)

  Sets the name of the math-ensuring LATEX command to `ensureMathCmd`.

  Parameters:
    `ensureMathCmd` - the new name of the math-ensuring command.

### format

    public String format(double x,
                         double error)

  Description copied from interface: `DoubleFormatterWithError`
  Formats the value `x` with error `error` into a string, and returns the formatted string. The error can be, e.g., the radius of a confidence interval, or a standard deviation. The given error must be used only to affect how `x` is formatted; it must be formatted into the returned string.

  Specified by:
    `format` in interface `DoubleFormatterWithError`
  Parameters:
    `x` - the value being formatted.
    `error` - the error on the formatted value.
  Returns:
    the formatted value.

### format

    public String format(double x)

  Description copied from interface: `DoubleFormatterWithError`
  This should be equivalent to `format (x, 0)`.

  Specified by:
    `format` in interface `DoubleFormatter`
  Specified by:
    `format` in interface `DoubleFormatterWithError`
  Parameters:
    `x` - the value being formatted.
  Returns:
    the formatted value.

Overview | Package | Class | Tree | Deprecated | Index | Help
| ContactCenters V. 0.9.9.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

To submit a bug or ask questions, send an e-mail to Richard Simard.