com.mapinfo.midev.unit

## Class PaperLength

- java.lang.Object
- - com.mapinfo.midev.unit.PaperLength

All Implemented Interfaces:
  Serializable

    public final class PaperLength
    extends Object
    implements Serializable

This class represents a length on paper (as opposed to a spatial reference).

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`PaperLength(double value, PaperUnit unit)` Create a paper length given a scalar value and a unit of measure.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `equals(Object o)` Equals implementation.
`PaperUnit` `getUnit()` Returns the unit of measure for this length.
`double` `getValue()` Returns the value of the measure.
`double` `getValue(PaperUnit unit, Integer dotsPerInch)` Return the length in the requested unit, converting if necessary.
`int` `hashCode()` Hashcode implementation.
`String` `toString()`

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

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

### Constructor Detail

#### PaperLength

    public PaperLength(double value,
                       PaperUnit unit)

Create a paper length given a scalar value and a unit of measure.

Example for a 1 inch length:
`new PaperLength(PaperUnit.INCH, 1.0);`

Parameters:
  `value` - The value of measure for this length.
  `unit` - The unit of measure for this length.
Throws:
  `IllegalArgumentException` - if the specified unit is null.

### Method Detail

#### getUnit

    public PaperUnit getUnit()

Returns the unit of measure for this length.

Returns:
  The unit of measure for this length.

#### getValue

    public double getValue()

Returns the value of the measure.

Returns:
  the value of the measure.

#### getValue

    public double getValue(PaperUnit unit,
                           Integer dotsPerInch)

Return the length in the requested unit, converting if necessary.

Parameters:
  `unit` - the desired unit.
Returns:
  the value of the length in the specified unit.
Throws:
  `IllegalArgumentException` - if the specified unit is null.

#### equals

    public boolean equals(Object o)

Equals implementation.

Overrides:
  `equals` in class `Object`
Parameters:
  `o` - The object to test for equality.
Returns:
  TRUE if this object equals the parameter object.

#### hashCode

    public int hashCode()

Hashcode implementation.

Overrides:
  `hashCode` in class `Object`
Returns:
  The hashCode for this object.

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`