|
Esri Geoportal Server 1.2.9
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.esri.gpt.framework.util.TimePeriod
public final class TimePeriod
Time period.
Represents time period in one of various forms indicating a number of
milliseconds to elapse until defined moment in time.
Generic way of creating instance of the class is to use static method
parseValue(java.lang.String). That method understands several
different ways of expressing a time period.
TimePeriod.parse("1000");
to create a a constant, one second period.
Another way to create period is to use one of the values from TimePeriod.Unit.
Combining integer value with the unit name simplifies expressing longer periods, for example:
TimePeriod.parse("2[DAY]");
gives just two days constant period.
There is also a way to express relative periods. Giving:
TimePeriod.parse("08:00");
gives a period from now on to the closest eight o'clock am every day.
It is also possible to use one of the values of TimePeriod.DayOfWeek, like this:
TimePeriod.parse("monday");
which means period from now on to the begining of the closes Monday, or even more specific way:
TimePeriod.parse("monday 08:00");
to have period from now on to the eight o'clock am of the Monday.
It is also possible to parse array of time periods:
TimePeriod.parse("08:00,sunday 10:00");
which gives period of eight o'clock every day and ten o'clock every sunday, whatever
comes first.
| Nested Class Summary | |
|---|---|
static class |
TimePeriod.DayOfWeek
Day of the week. |
static class |
TimePeriod.Unit
Time unit. |
| Constructor Summary | |
|---|---|
TimePeriod()
Creates instance of time period. |
|
TimePeriod(long value)
Creates instance of time period. |
|
TimePeriod(long value,
TimePeriod.Unit unit)
Creates instance of time period. |
|
| Method Summary | |
|---|---|
long |
getValue()
Gets value. |
long |
getValue(Date since)
Gets value. |
static TimePeriod |
parseValue(String value)
Parses value into time period. |
void |
setValue(long value)
Sets value. |
void |
setValue(long value,
TimePeriod.Unit unit)
Sets value. |
String |
toLocalizedString(MessageBroker mb)
Converts into localized string. |
String |
toString()
Creates string representation of the object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TimePeriod()
public TimePeriod(long value)
value - value in milliseconds
public TimePeriod(long value,
TimePeriod.Unit unit)
value - value in millisecondsunit - unit| Method Detail |
|---|
public long getValue()
public long getValue(Date since)
since - since
public void setValue(long value)
value - value in milliseconds
public void setValue(long value,
TimePeriod.Unit unit)
value - valueunit - unit
public static TimePeriod parseValue(String value)
throws IllegalArgumentException
value - value to parse
IllegalArgumentException - if unable to parse valuepublic String toString()
toString in class Objectpublic String toLocalizedString(MessageBroker mb)
mb - message broker
|
Esri Geoportal Server 1.2.9
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||