public class TimeSpan extends Object implements Comparable
Constructor and Description |
---|
TimeSpan()
Creates an instance of the
TimeSpan class with zero for minimum and maximum values. |
TimeSpan(Calendar min,
Calendar max)
Creates a
TimeSpan with the specified min and max values. |
Modifier and Type | Method and Description |
---|---|
int |
compareTo(Object param) |
static TimeSpan |
fromDays(long days)
Creates a new
TimeSpan instance from the specified days. |
static TimeSpan |
fromHours(long hours)
Creates a new
TimeSpan instance from the specified hours. |
static TimeSpan |
fromMilliseconds(long millis)
Creates a time span from the given milliseconds.
|
static TimeSpan |
fromMinutes(long minutes)
Creates a new
TimeSpan instance from the specified minutes. |
static TimeSpan |
fromSeconds(long seconds)
Creates a new
TimeSpan instance from the specified seconds. |
long |
getMillis()
Gets the milliseconds that represent this
TimeSpan . |
int |
getTotalDays()
Gets the total days contained in this
TimeSpan . |
static TimeSpan |
getZero()
Creates an empty
TimeSpan instance. |
public TimeSpan(Calendar min, Calendar max)
TimeSpan
with the specified min and max values.min
- The start of the time span.max
- The end of the time span.public TimeSpan()
TimeSpan
class with zero for minimum and maximum values.public static TimeSpan fromDays(long days)
TimeSpan
instance from the specified days.days
- The time span in days.TimeSpan
instance.public static TimeSpan fromSeconds(long seconds)
TimeSpan
instance from the specified seconds.seconds
- The time span in seconds.TimeSpan
instance.public static TimeSpan fromMinutes(long minutes)
TimeSpan
instance from the specified minutes.minutes
- The time span in minutes.TimeSpan
instance.public static TimeSpan fromHours(long hours)
TimeSpan
instance from the specified hours.hours
- The time span in hours.TimeSpan
instance.public static TimeSpan fromMilliseconds(long millis)
millis
- The milliseconds.TimeSpan
public static TimeSpan getZero()
TimeSpan
instance.TimeSpan
instance.public int getTotalDays()
TimeSpan
.TimeSpan
.public long getMillis()
TimeSpan
.TimeSpan
.public int compareTo(Object param)
compareTo
in interface Comparable