public class Period
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static long |
DAY |
static long |
FOREVER |
static long |
HOUR |
static long |
INFINITE |
static long |
MINUTE |
static long |
MONTH
30 days
|
static long |
SECOND |
static long |
YEAR
365 days
|
Modifier and Type | Method and Description |
---|---|
void |
addText(java.lang.String text)
Sets the text.
|
long |
getDefaultUnits()
Returns the default units (default is 1000)
|
long |
getPeriod()
Replace with the real path.
|
static long |
periodEnd(long now,
long period)
Calculates the next period end.
|
static long |
toPeriod(java.lang.String value)
Converts a period string to a time.
|
static long |
toPeriod(java.lang.String value,
long defaultUnits)
Converts a period string to a time.
|
java.lang.String |
toString() |
public static final long SECOND
public static final long MINUTE
public static final long HOUR
public static final long DAY
public static final long MONTH
public static final long YEAR
public static final long INFINITE
public static final long FOREVER
public long getDefaultUnits()
public void addText(java.lang.String text) throws ConfigException
ConfigException
public long getPeriod()
public static long toPeriod(java.lang.String value) throws ConfigException
ms | milliseconds |
s | seconds |
m | minutes |
h | hours |
D | days |
W | weeks |
M | months |
Y | years |
ConfigException
public static long toPeriod(java.lang.String value, long defaultUnits) throws ConfigException
ms | milliseconds |
s | seconds |
m | minutes |
h | hours |
D | days |
W | weeks |
M | months |
Y | years |
ConfigException
public static long periodEnd(long now, long period)
now
- the current time in GMT ms since the epochpublic java.lang.String toString()
toString
in class java.lang.Object