com.mapinfo.midev.type

## Class MITime

- java.lang.Object
- - com.mapinfo.midev.type.MITime

All Implemented Interfaces:
  Serializable, Comparable

    public class MITime
    extends Object
    implements Comparable, Serializable

Represents a time expressed in hour, minute, and seconds.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`MITime(Date time)` Constructs a new instance using from `java.util.date` using joda api.
`MITime(int hour, int minute, double seconds)` Constructs a new instance.
`MITime(long milliSeconds)` Constructs a new instance.

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `compareTo(MITime time)`
`boolean` `equals(Object o)`
`int` `getHour()` Returns the hour
`int` `getMinute()` Returns the minute of the hour.
`double` `getSeconds()` Returns the seconds.
`long` `getTimeInMilliSeconds()` Returns the number of milliseconds since the start of the day.
`int` `hashCode()`
`String` `toString()` Returns an `MITime` as a String in hh:mm:ss format.

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

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

### Constructor Detail

#### MITime

    public MITime(int hour,
                  int minute,
                  double seconds)

Constructs a new instance.

Parameters:
  `hour` - the hour
  `minute` - the minute
  `seconds` - the seconds

#### MITime

    public MITime(long milliSeconds)

Constructs a new instance. The time fields are initialized from the appropriate values in the supplied time in milliseconds. This time is consistent with values obtained from `Calendar.getTimeInMillis()` or `System.currentTimeMillis()`.

Parameters:
  `milliSeconds` - time in milliseconds to use to initialize this instance.

#### MITime

    public MITime(Date time)

Constructs a new instance using from `java.util.date` using joda api.

Parameters:
  `time` -

### Method Detail

#### getHour

    public int getHour()

Returns the hour

Returns:
  the hour.

#### getMinute

    public int getMinute()

Returns the minute of the hour.

Returns:
  the minute of the hour.

#### getTimeInMilliSeconds

    public long getTimeInMilliSeconds()

Returns the number of milliseconds since the start of the day.

Returns:
  the number of milliseconds since the start of the day.

#### getSeconds

    public double getSeconds()

Returns the seconds. The seconds supplied are retained and returned by this method. However, equality are comparisons are sensitive to milliseconds only.

Returns:
  the seconds.

#### compareTo

    public int compareTo(MITime time)

Specified by:
  `compareTo` in interface `Comparable`

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### toString

    public String toString()

Returns an `MITime` as a String in hh:mm:ss format.

Overrides:
  `toString` in class `Object`
Returns:
  an `MITime` as a String in hh:mm:ss format.