|
||||||||||
| PREV CLASS NEXT CLASS | All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.teraspaces.qwframework.TimeSpan
public class TimeSpan
Represents a Java implementation of .Net TimeSpan class.
| Field Summary | |
|---|---|
static TimeSpan |
MAX_VALUE
Represents the maximum TimeSpan value. |
static TimeSpan |
MIN_VALUE
Represents the minimum TimeSpan value. |
static long |
TICKS_PER_DAY
Represents the number of ticks in 1 day. |
static long |
TICKS_PER_HOUR
Represents the number of ticks in 1 hour. |
static long |
TICKS_PER_MILLISECOND
Represents the number of ticks in 1 millisecond. |
static long |
TICKS_PER_MINUTE
Represents the number of ticks in 1 minute. |
static long |
TICKS_PER_SECOND
Represents the number of ticks in 1 second. |
static TimeSpan |
ZERO
Represents the zero TimeSpan value. |
| Constructor Summary | |
|---|---|
TimeSpan(int hours,
int minutes,
int seconds)
Instantiates a new time span. |
|
TimeSpan(int days,
int hours,
int minutes,
int seconds)
Instantiates a new time span. |
|
TimeSpan(int days,
int hours,
int minutes,
int seconds,
int milliseconds)
Instantiates a new time span. |
|
TimeSpan(long ticks)
Instantiates a new time span. |
|
| Method Summary | |
|---|---|
TimeSpan |
add(TimeSpan ts)
Adds the specified TimeSpan to this instance. |
static int |
compare(TimeSpan t1,
TimeSpan t2)
Compares two TimeSpan values and returns an integer that indicates whether the first value is shorter than, equal to, or longer than the second value. |
int |
compareTo(TimeSpan value)
|
static long |
createTicks(int days,
int hours,
int minutes,
int seconds,
int milliseconds)
Creates the ticks of a TimeSpan. |
TimeSpan |
duration()
Duration. |
boolean |
equals(Object value)
|
boolean |
equals(TimeSpan obj)
Equals. |
static boolean |
equals(TimeSpan t1,
TimeSpan t2)
Equals. |
static TimeSpan |
fromDays(double value)
From days. |
static TimeSpan |
fromHours(double value)
From hours. |
static TimeSpan |
fromMilliseconds(double value)
From milliseconds. |
static TimeSpan |
fromMinutes(double value)
From minutes. |
static TimeSpan |
fromSeconds(double value)
From seconds. |
static TimeSpan |
fromTicks(long value)
From ticks. |
int |
getDays()
Gets the days. |
static int |
getDays(long ticks)
Gets the day component of a TimeSpan from ticks. |
int |
getHours()
Gets the hours. |
static int |
getHours(long ticks)
Gets the hour component of a TimeSpan from ticks. |
int |
getMilliseconds()
Gets the milliseconds. |
static int |
getMilliseconds(long ticks)
Gets the millisecond component of a TimeSpan from ticks. |
int |
getMinutes()
Gets the minutes. |
static int |
getMinutes(long ticks)
Gets the minute component of a TimeSpan from ticks. |
int |
getSeconds()
Gets the seconds. |
static int |
getSeconds(long ticks)
Gets the second component of a TimeSpan from ticks. |
long |
getTicks()
Gets the ticks. |
double |
getTotalDays()
Gets the total days. |
static double |
getTotalDays(long ticks)
Gets the total days of a TimeSpan from ticks. |
double |
getTotalHours()
Gets the total hours. |
static double |
getTotalHours(long ticks)
Gets the total hours of a TimeSpan from ticks. |
double |
getTotalMilliseconds()
Gets the total milliseconds of a TimeSpan from ticks. |
static double |
getTotalMilliseconds(long ticks)
Gets the total milliseconds. |
double |
getTotalMinutes()
Gets the total minutes. |
static double |
getTotalMinutes(long ticks)
Gets the total minutes of a TimeSpan from ticks. |
double |
getTotalSeconds()
Gets the total seconds. |
static double |
getTotalSeconds(long ticks)
Gets the total seconds of a TimeSpan from ticks. |
int |
hashCode()
|
TimeSpan |
negate()
Negate. |
static TimeSpan |
parse(String s)
Parses the. |
TimeSpan |
subtract(TimeSpan ts)
Subtract. |
String |
toString()
|
static TimeSpan |
valueOf(String s)
Value of. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final long TICKS_PER_MILLISECOND
public static final long TICKS_PER_SECOND
public static final long TICKS_PER_MINUTE
public static final long TICKS_PER_HOUR
public static final long TICKS_PER_DAY
public static final TimeSpan ZERO
public static final TimeSpan MAX_VALUE
public static final TimeSpan MIN_VALUE
| Constructor Detail |
|---|
public TimeSpan(long ticks)
ticks - the ticks
public TimeSpan(int hours,
int minutes,
int seconds)
hours - the hoursminutes - the minutesseconds - the seconds
public TimeSpan(int days,
int hours,
int minutes,
int seconds)
days - the dayshours - the hoursminutes - the minutesseconds - the seconds
public TimeSpan(int days,
int hours,
int minutes,
int seconds,
int milliseconds)
days - the dayshours - the hoursminutes - the minutesseconds - the secondsmilliseconds - the milliseconds| Method Detail |
|---|
public static long createTicks(int days,
int hours,
int minutes,
int seconds,
int milliseconds)
days - the dayshours - the hoursminutes - the minutesseconds - the secondsmilliseconds - the milliseconds
public long getTicks()
public int getDays()
public static int getDays(long ticks)
ticks - the ticks
public int getHours()
public static int getHours(long ticks)
ticks - the ticks
public int getMilliseconds()
public static int getMilliseconds(long ticks)
ticks - the ticks
public int getMinutes()
public static int getMinutes(long ticks)
ticks - the ticks
public int getSeconds()
public static int getSeconds(long ticks)
ticks - the ticks
public double getTotalDays()
public static double getTotalDays(long ticks)
ticks - the ticks
public double getTotalHours()
public static double getTotalHours(long ticks)
ticks - the ticks
public double getTotalMilliseconds()
public static double getTotalMilliseconds(long ticks)
ticks - the ticks
public double getTotalMinutes()
public static double getTotalMinutes(long ticks)
ticks - the ticks
public double getTotalSeconds()
public static double getTotalSeconds(long ticks)
ticks - the ticks
public TimeSpan add(TimeSpan ts)
ts - a TimeSpan
public static int compare(TimeSpan t1,
TimeSpan t2)
t1 - the first TimeSpant2 - the second TimeSpan
public int compareTo(TimeSpan value)
compareTo in interface Comparable<TimeSpan>public static TimeSpan fromDays(double value)
value - the value
public TimeSpan duration()
public boolean equals(Object value)
equals in class Objectpublic boolean equals(TimeSpan obj)
obj - the obj
public static boolean equals(TimeSpan t1,
TimeSpan t2)
t1 - the t1t2 - the t2
public int hashCode()
hashCode in class Objectpublic static TimeSpan fromHours(double value)
value - the value
public static TimeSpan fromMilliseconds(double value)
value - the value
public static TimeSpan fromMinutes(double value)
value - the value
public TimeSpan negate()
public static TimeSpan fromSeconds(double value)
value - the value
public TimeSpan subtract(TimeSpan ts)
ts - the ts
public static TimeSpan fromTicks(long value)
value - the value
public static TimeSpan parse(String s)
s - the s
public String toString()
toString in class Objectpublic static TimeSpan valueOf(String s)
s - the s
|
||||||||||
| PREV CLASS NEXT CLASS | All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||