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 {@link TimePeriod#parseValue(java.lang.String)}. That method understands several different ways of expressing a time period. The simplest way of creating time period is by providing number of milliseconds. Use a simple integer number like this:
TimePeriod.parse("1000");
to create a a constant, one second period. Another way to create period is to use one of the values from {@link 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 {@link 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.