com.mapinfo.midev.unit

## Class TimeUnit

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

All Implemented Interfaces:
  Serializable, Comparable

    public final class TimeUnit
    extends Enum

A unit of measure for time.

See Also:
  Serialized Form

### Field Summary

Fields
`static TimeUnit` `DAY` A TimeUnit representing day.
`static TimeUnit` `HOUR` A TimeUnit representing hours.
`static TimeUnit` `MILLISECOND` A TimeUnit representing milliseconds.
`static TimeUnit` `MINUTE` A TimeUnit representing minutes.
`static TimeUnit` `SECOND` A TimeUnit representing seconds.
`static TimeUnit` `WEEK` A TimeUnit representing week.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static double` `convert(double time, TimeUnit fromUnit, TimeUnit toUnit)` Convert the specified time to its equivalent value in another time unit.
`double` `getSecondsPerUnit()` Get the number of seconds equivalent to one of this unit of measure.
`static TimeUnit` `valueOf(String name)`
`static TimeUnit[]` `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

#### MILLISECOND

    public static final TimeUnit MILLISECOND

A TimeUnit representing milliseconds.

#### SECOND

    public static final TimeUnit SECOND

A TimeUnit representing seconds.

#### MINUTE

    public static final TimeUnit MINUTE

A TimeUnit representing minutes.

#### HOUR

    public static final TimeUnit HOUR

A TimeUnit representing hours.

#### DAY

    public static final TimeUnit DAY

A TimeUnit representing day.

#### WEEK

    public static final TimeUnit WEEK

A TimeUnit representing week.

### Method Detail

#### values

    public static TimeUnit[] values()

#### valueOf

    public static TimeUnit valueOf(String name)

#### getSecondsPerUnit

    public double getSecondsPerUnit()

Get the number of seconds equivalent to one of this unit of measure.

Returns:
  The number of seconds equivalent to one of this unit of measure.

#### convert

    public static double convert(double time,
                                 TimeUnit fromUnit,
                                 TimeUnit toUnit)

Convert the specified time to its equivalent value in another time unit.

Parameters:
  `time` - A time with unit fromUnit
  `fromUnit` - The time unit of the specified time.
  `toUnit` - The time unit for the converted value.
Returns:
  The converted time in the specified units.