com.mapinfo.midev.type

## Class MITimespan

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

All Implemented Interfaces:
  Serializable, Comparable

    public final class MITimespan
    extends Object
    implements Comparable, Serializable

A span of time in hours, minutes and seconds.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`MITimespan(int days, int hours, int minutes, double seconds)` Constructs a new instance.
`MITimespan(long milliseconds)` Constructs a new instance.

### Method Summary

All Methods Instance Methods Concrete Methods
`int` `compareTo(MITimespan timespan)`
`boolean` `equals(Object o)`
`int` `getDays()` Returns the number of days in the timespan.
`int` `getHours()` Returns the number of hours in the timespan.
`int` `getMinutes()` Returns the number of minutes in the timespan.
`double` `getSeconds()` Returns the number of seconds in the timespan.
`long` `getTimespanInMilliSeconds()` Returns the timespan as the number of milliseconds since the Epoch.
`int` `hashCode()`
`String` `toString()`

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

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

### Constructor Detail

#### MITimespan

    public MITimespan(int days,
                      int hours,
                      int minutes,
                      double seconds)

Constructs a new instance.

Parameters:
  `days` - number of days
  `hours` - number of hours
  `minutes` - number of minutes
  `seconds` - number of seconds (accurate to the millisecond)

#### MITimespan

    public MITimespan(long milliseconds)

Constructs a new instance. This time is consistent with values obtained from `Calendar.getTimeInMillis()` or `System.currentTimeMillis()`.

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

### Method Detail

#### getTimespanInMilliSeconds

    public long getTimespanInMilliSeconds()

Returns the timespan as the number of milliseconds since the Epoch.

Returns:
  the timespan as the difference in milliseconds from the Epoch.
See Also:
  `Calendar`

#### getDays

    public int getDays()

Returns the number of days in the timespan.

Returns:
  the number of days in the timespan.

#### getHours

    public int getHours()

Returns the number of hours in the timespan.

Returns:
  the number of hours in the timespan.

#### getMinutes

    public int getMinutes()

Returns the number of minutes in the timespan.

Returns:
  the number of minutes in the timespan.

#### getSeconds

    public double getSeconds()

Returns the number of seconds in the timespan.

Returns:
  the number of seconds in the timespan.

#### compareTo

    public int compareTo(MITimespan timespan)

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()

Overrides:
  `toString` in class `Object`