|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.starteam.util.TimeSpan
public final class TimeSpan
The amount of time between two DateTimes.
| Field Summary | |
|---|---|
static TimeSpan |
MAX_VALUE
The largest value of a TimeSpan (DoubleProperty.MAX_VALUE) |
static TimeSpan |
MIN_VALUE
The smallest value of a TimeSpan (DoubleProperty.MIN_VALUE) |
static TimeSpan |
ZERO
A TimeSpan of value 0.0 |
| Method Summary | |
|---|---|
TimeSpan |
add(TimeSpan b)
returns a TimeSpan composed from the addition of a TimeSpan to this instance |
static TimeSpan |
add(TimeSpan a,
TimeSpan b)
returns a TimeSpan created from the addition of 2 Timespan instances |
static int |
compare(TimeSpan a,
TimeSpan b)
returns the result of a comparison between two TimeSpan's |
int |
compareTo(TimeSpan b)
compares a TimeSpan to this instance |
TimeSpan |
duration()
returns the real duration in time for this TimeSpan, i.e. |
boolean |
equals(java.lang.Object obj)
Compare this TimeSpan to another one. |
static TimeSpan |
fromDays(double days)
returns a time span created from a specified number of days |
static TimeSpan |
fromDays(int days,
int hrs,
int min,
int sec)
returns a TimeSpan created from the specified number of days, hours, minutes and seconds |
static TimeSpan |
fromDays(int days,
int hrs,
int min,
int sec,
int msec)
returns a TimeSpan created from the specified number of days, hours, minutes, seconds and milliseconds |
static TimeSpan |
fromHours(double hours)
returns a time span created from a specified number of hours |
static TimeSpan |
fromHours(int hrs,
int min,
int sec)
returns a TimeSpan created from the specified number of hours, minutes and seconds |
static TimeSpan |
fromHours(int hrs,
int min,
int sec,
int msec)
returns a TimeSpan created from the specified number of hours, minutes, seconds and milliseconds |
static TimeSpan |
fromMilliseconds(double milliseconds)
returns a time span created from a specified number of milliseconds |
static TimeSpan |
fromMinutes(double minutes)
returns a time span created from a specified number of minutes |
static TimeSpan |
fromMonths(double months)
returns a time span created from a specified number of months |
static TimeSpan |
fromSeconds(double seconds)
returns a time span created from a specified number of seconds |
static TimeSpan |
fromTicks(long ticks)
returns a time span created from a specified number of ticks |
static TimeSpan |
fromWeeks(double weeks)
returns a time span created from a specified number of weeks |
static TimeSpan |
fromYears(double years)
returns a time span created from a specified number of years |
int |
getDaysPart()
returns the number of whole (24 hour) days in this TimeSpan |
int |
getHoursPart()
returns the number of whole hours in this TimeSpan |
int |
getMillisecondsPart()
returns the number of whole milliseconds in this TimeSpan |
int |
getMinutesPart()
returns the number of whole minutes in this TimeSpan |
int |
getSecondsPart()
returns the number of whole seconds in this TimeSpan |
int |
hashCode()
Gets a unique hash for this TimeSpan |
boolean |
isEqualTo(TimeSpan t)
Compare this TimeSpan to another one. |
TimeSpan |
negate()
returns a TimeSpan composed by subtracting this TimeSpan instance from ZERO |
static TimeSpan |
parse(java.lang.String timespan)
Returns a TimeSpan composed by parsing the specified String representation. |
TimeSpan |
subtract(TimeSpan b)
returns a TimeSpan composed from the subtraction of a TimeSpan from this instance |
static TimeSpan |
subtract(TimeSpan a,
TimeSpan b)
returns a TimeSpan created from the subtraction of 2 Timespan instances |
double |
toDays()
returns the number of days in this TimeSpan |
double |
toHours()
returns the number of hours in this TimeSpan |
double |
toMilliseconds()
returns the number of milliseconds in this TimeSpan |
double |
toMinutes()
returns the number of minutes in this TimeSpan |
double |
toMonths()
returns the number of months in this TimeSpan in 30 day increments. |
double |
toSeconds()
returns the number of seconds in this TimeSpan |
java.lang.String |
toString()
returns a string representation of this instance in the form "[-][d.]hh:mm:ss[.ff]" |
long |
toTicks()
returns the number of ticks in this TimeSpan (a tick is 100 nanoseconds) |
double |
toWeeks()
returns the number of weeks in this TimeSpan |
double |
toYears()
returns the number of years in this TimeSpan in 365 day increments. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final TimeSpan MIN_VALUE
public static final TimeSpan MAX_VALUE
public static final TimeSpan ZERO
| Method Detail |
|---|
public static TimeSpan add(TimeSpan a,
TimeSpan b)
a - TimeSpanb - TimeSpan
public static TimeSpan subtract(TimeSpan a,
TimeSpan b)
a - TimeSpanb - TimeSpan
public static TimeSpan fromYears(double years)
years - double (in 365 day increments). This transformation may be
lossy
public static TimeSpan fromMonths(double months)
months - double (in 30 day increments). This transformation may be
lossy
public static TimeSpan fromWeeks(double weeks)
weeks - double (in 7 day increments)
public static TimeSpan fromDays(double days)
days - double
public static TimeSpan fromHours(double hours)
hours - double
public static TimeSpan fromMinutes(double minutes)
minutes - double
public static TimeSpan fromSeconds(double seconds)
seconds - double
public static TimeSpan fromMilliseconds(double milliseconds)
milliseconds - double
public static TimeSpan fromTicks(long ticks)
ticks - long (1 tick = 100 nanosecs)
public static TimeSpan fromHours(int hrs,
int min,
int sec)
hrs - intmin - intsec - int
public static TimeSpan fromHours(int hrs,
int min,
int sec,
int msec)
hrs - intmin - intsec - intmsec - int
public static TimeSpan fromDays(int days,
int hrs,
int min,
int sec)
days - inthrs - intmin - intsec - int
public static TimeSpan fromDays(int days,
int hrs,
int min,
int sec,
int msec)
days - inthrs - intmin - intsec - intmsec - int
public double toYears()
public double toMonths()
public double toWeeks()
public double toDays()
public double toHours()
public double toMinutes()
public double toSeconds()
public double toMilliseconds()
public long toTicks()
public int getDaysPart()
public int getHoursPart()
public int getMinutesPart()
public int getSecondsPart()
public int getMillisecondsPart()
public TimeSpan add(TimeSpan b)
b - the TimeSpan to add to this instance
public TimeSpan subtract(TimeSpan b)
b - the TimeSpan to subtract from this instance
public static int compare(TimeSpan a,
TimeSpan b)
a - TimeSpanb - TimeSpan
public int compareTo(TimeSpan b)
b - TimeSpan
public TimeSpan negate()
public TimeSpan duration()
public java.lang.String toString()
toString in class java.lang.ObjectTimeSpanFormatter.format(TimeSpan)public static TimeSpan parse(java.lang.String timespan)
timespan - a String representation of a TimeSpan
public boolean isEqualTo(TimeSpan t)
t - The TimeSpan to be compared to this one.
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - The TimeSpan to be compared to this one.
public int hashCode()
hashCode in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||