Package com.gentlyweb.utils
Class TimeDuration
- java.lang.Object
-
- com.gentlyweb.utils.TimeDuration
-
public class TimeDuration extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_FORMAT_SPEC
-
Constructor Summary
Constructors Constructor Description TimeDuration(int days, int hours, int mins, int secs)
TimeDuration(int days, int hours, int mins, int secs, int millis)
TimeDuration(long millis)
TimeDuration(TimeDuration t)
TimeDuration(Date d)
TimeDuration(Date from, Date to)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(TimeDuration t)
String
format()
String
format(String spec)
Date
getAsDate()
int
getDays()
int
getHours()
static TimeDuration
getInstance(long millis)
static TimeDuration
getInstance(TimeDuration t)
static TimeDuration
getInstance(Timing t)
static TimeDuration
getInstance(Date d)
int
getMillis()
int
getMins()
int
getSecs()
void
init(long millis)
void
init(TimeDuration t)
long
rollUpToMillis()
void
setDays(int d)
void
setHours(int h)
void
setMillis(int m)
void
setMins(int m)
void
setSecs(int s)
void
subtract(TimeDuration t)
-
-
-
Field Detail
-
DEFAULT_FORMAT_SPEC
public static final String DEFAULT_FORMAT_SPEC
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TimeDuration
public TimeDuration(int days, int hours, int mins, int secs)
-
TimeDuration
public TimeDuration(Date d)
-
TimeDuration
public TimeDuration(long millis)
-
TimeDuration
public TimeDuration(TimeDuration t)
-
TimeDuration
public TimeDuration(int days, int hours, int mins, int secs, int millis)
-
-
Method Detail
-
init
public void init(long millis)
-
init
public void init(TimeDuration t)
-
subtract
public void subtract(TimeDuration t)
-
add
public void add(TimeDuration t)
-
getInstance
public static TimeDuration getInstance(TimeDuration t)
-
getInstance
public static TimeDuration getInstance(Timing t)
-
getInstance
public static TimeDuration getInstance(Date d)
-
getInstance
public static TimeDuration getInstance(long millis)
-
getAsDate
public Date getAsDate()
-
rollUpToMillis
public long rollUpToMillis()
-
setMillis
public void setMillis(int m)
-
getMillis
public int getMillis()
-
setSecs
public void setSecs(int s)
-
getSecs
public int getSecs()
-
setMins
public void setMins(int m)
-
getMins
public int getMins()
-
setHours
public void setHours(int h)
-
getHours
public int getHours()
-
setDays
public void setDays(int d)
-
getDays
public int getDays()
-
format
public String format()
-
-