com.mapinfo.midev.unit

## Class PaperUnit

- java.lang.Object
- - java.lang.Enum
  - - com.mapinfo.midev.unit.PaperUnit

All Implemented Interfaces:
  Serializable, Comparable

    public final class PaperUnit
    extends Enum
    implements Serializable

This class represents a unit of measure for length on paper (as opposed to spatial).

See Also:
  Serialized Form

### Field Summary

Fields
`static PaperUnit` `CENTIMETER` Unit representing centimeter.
`static int` `DEFAULT_DPI` The default DPI (Dots Per Inch).
`static PaperUnit` `INCH` Unit representing inch.
`static PaperUnit` `METER` Unit representing meter.
`static PaperUnit` `MILLIMETER` Unit representing millimeter.
`static PaperUnit` `PICA` Unit representing pica.
`static PaperUnit` `PIXEL` Unit representing pixel.
`static PaperUnit` `POINT` Unit representing point.
`static PaperUnit` `TWIP` Unit representing twip.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static double` `calculateConversionFactor(PaperUnit fromUnit, PaperUnit toUnit, Integer dotsPerInch)` Returns the conversion factor used toUnit convert something in the specified fromUnit PaperUnit toUnit the specified toUnit PaperUnit.
`static double` `convert(double length, PaperUnit fromUnit, PaperUnit toUnit, Integer dotsPerInch)` Returns the conversion of the specified length in the specified PaperUnit to the specified PaperUnit.
`double` `getPointsPerUnit()` Returns the number of points per unit of this measurement.
`static PaperUnit` `valueOf(String name)`
`static PaperUnit[]` `values()`

### Methods inherited from class java.lang.Enum

`compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf`

### Methods inherited from class java.lang.Object

`getClass, notify, notifyAll, wait, wait, wait`

### Field Detail

#### INCH

    public static final PaperUnit INCH

Unit representing inch.

#### POINT

    public static final PaperUnit POINT

Unit representing point.

#### PICA

    public static final PaperUnit PICA

Unit representing pica.

#### TWIP

    public static final PaperUnit TWIP

Unit representing twip.

#### MILLIMETER

    public static final PaperUnit MILLIMETER

Unit representing millimeter.

#### CENTIMETER

    public static final PaperUnit CENTIMETER

Unit representing centimeter.

#### PIXEL

    public static final PaperUnit PIXEL

Unit representing pixel.

#### METER

    public static final PaperUnit METER

Unit representing meter.

#### DEFAULT_DPI

    public static final int DEFAULT_DPI

The default DPI (Dots Per Inch).

See Also:
  Constant Field Values

### Method Detail

#### values

    public static PaperUnit[] values()

#### valueOf

    public static PaperUnit valueOf(String name)

#### getPointsPerUnit

    public double getPointsPerUnit()

Returns the number of points per unit of this measurement.

Returns:
  the number of points per unit of this measurement.

#### convert

    public static double convert(double length,
                                 PaperUnit fromUnit,
                                 PaperUnit toUnit,
                                 Integer dotsPerInch)

Returns the conversion of the specified length in the specified PaperUnit to the specified PaperUnit.

Parameters:
  `length` - The length to convert.
  `fromUnit` - The units of the length to convert.
  `toUnit` - The unit to convert the length to.
  `dotsPerInch` - The dots per inch. It's required only when PaperUnit.PIXEL is involved.
Returns:
  the conversion of the specified length in the specified PaperUnit to the specified PaperUnit.

#### calculateConversionFactor

    public static double calculateConversionFactor(PaperUnit fromUnit,
                                                   PaperUnit toUnit,
                                                   Integer dotsPerInch)

Returns the conversion factor used toUnit convert something in the specified fromUnit PaperUnit toUnit the specified toUnit PaperUnit.

Parameters:
  `fromUnit` - The PaperUnit toUnit convert fromUnit.
  `toUnit` - The PaperUnit toUnit convert toUnit.
  `dotsPerInch` - The dots per inch. It's required only when PaperUnit.PIXEL is involved.
Returns:
  the conversion factor used toUnit convert something in the specified fromUnit PaperUnit toUnit the specified toUnit PaperUnit.