public class MTimeInterval extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DAY |
static long |
DAY_IN_MILLISECOUNDS |
static int |
HOUR |
static long |
HOUR_IN_MILLISECOUNDS |
static int |
MILLISECOND |
static int |
MINUTE |
static long |
MINUTE_IN_MILLISECOUNDS |
static int |
SECOND |
static long |
SECOUND_IN_MILLISECOUNDS |
static int |
WEEK |
static long |
WEEK_IN_MILLISECOUNDS |
| Constructor and Description |
|---|
MTimeInterval() |
MTimeInterval(String _interval) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int _type,
long _value) |
void |
add(MTimeInterval interval) |
long |
getAllDays() |
long |
getAllMilliseconds() |
long |
getAllMinutes() |
long |
getAllSecounds() |
long |
getAllWeeks() |
int |
getDays() |
int |
getHours() |
int |
getMilliseconds() |
int |
getMinutes() |
int |
getSeconds() |
int |
getWeeks() |
void |
join(Calendar _cal) |
Date |
join(Date _date) |
void |
optimize() |
void |
parse(String _interval) |
static long |
toMilliseconds(String interval,
int def)
Parse a string and returns an interval, possible formats are
Secounds: 123425
Secounds and millis: 12345.123
Format: Day Hour:Minutes:Secounds.Millis or DD HH:MM:ss.SSS
or ss, ss.SSS, MM:ss.SSS, HH:MM:ss.SSS, MM:ss, HH:MM:ss
|
String |
toString() |
public static final long SECOUND_IN_MILLISECOUNDS
public static final long MINUTE_IN_MILLISECOUNDS
public static final long HOUR_IN_MILLISECOUNDS
public static final long DAY_IN_MILLISECOUNDS
public static final long WEEK_IN_MILLISECOUNDS
public static final int MILLISECOND
public static final int SECOND
public static final int MINUTE
public static final int HOUR
public static final int DAY
public static final int WEEK
public MTimeInterval()
public MTimeInterval(String _interval) throws NumberFormatException
NumberFormatExceptionpublic void parse(String _interval) throws NumberFormatException
NumberFormatExceptionpublic void add(MTimeInterval interval)
public void add(int _type,
long _value)
public void optimize()
public void join(Calendar _cal)
public static long toMilliseconds(String interval, int def)
interval - def - public int getMilliseconds()
public int getSeconds()
public int getMinutes()
public int getHours()
public int getDays()
public int getWeeks()
public long getAllMilliseconds()
public long getAllSecounds()
public long getAllMinutes()
public long getAllDays()
public long getAllWeeks()
Copyright © 2014. All rights reserved.