com.mapinfo.midev.unit

## Class Area

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

All Implemented Interfaces:
  Serializable

    public final class Area
    extends Object
    implements Serializable

Class that represents the value, unit and computation type of an area measure.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`Area(double value, AreaUnit unit)` Create an area with computation type `ComputationType.SPHERICAL`.
`Area(double value, AreaUnit unit, ComputationType computationType)` Create an area.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `equals(Object o)` Equals implementation.
`ComputationType` `getComputationType()` Returns the computation type used to interpret geometry coordinates when doing the area computations.
`AreaUnit` `getUnit()` Get the unit of measure for this area.
`double` `getValue()` Get the value of measure for this area.
`double` `getValue(AreaUnit unit)` Return the length in the requested unit, converting if necessary.
`int` `hashCode()` Hashcode implementation.

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

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

### Constructor Detail

#### Area

    public Area(double value,
                AreaUnit unit)

Create an area with computation type `ComputationType.SPHERICAL`.

Parameters:
  `value` - the value of measure for this area.
  `unit` - the unit of measure for this area.
Throws:
  `IllegalArgumentException` - if the specified value is less than 0, unit is null or the specified computation type is null.

#### Area

    public Area(double value,
                AreaUnit unit,
                ComputationType computationType)

Create an area.

Parameters:
  `value` - the value of measure for this area.
  `unit` - the unit of measure for this area.
  `computationType` - the computation type.
Throws:
  `IllegalArgumentException` - if the specified value is less than 0, unit is null or the specified computation type is null.

### Method Detail

#### getUnit

    public AreaUnit getUnit()

Get the unit of measure for this area.

Returns:
  The unit of measure for this area.

#### getValue

    public double getValue()

Get the value of measure for this area. The unit of this value is the unit returned by `Area.getUnit()`.

Returns:
  The value of measure for this area

#### getValue

    public double getValue(AreaUnit unit)

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.

#### getComputationType

    public ComputationType getComputationType()

Returns the computation type used to interpret geometry coordinates when doing the area computations.

Returns:
  The computation type for this area.

#### 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.