|
|
|
|
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||
java.lang.Objectjava.lang.Enum<Period>
org.torweg.pulse.util.time.Period
public enum Period
Defines constant values representing periods for working with Durations.
| Nested Class Summary | |
|---|---|
static class |
Period.Level
The known levels. |
static class |
Period.Scroll
The known values for scrolling Durations. |
| Enum Constant Summary | |
|---|---|
DAY
A full day [00:00:00.000 - 23:59:59.999]. |
|
HOUR
A full hour [?? |
|
MINUTE
A full minute [?? |
|
MONTH
A month - all full days of a month. |
|
SECOND
A full second [?? |
|
UNDEFINED
Defines an "undefined" Period. |
|
WEEK
A week - a sequence of seven full days [Sunday - Saturday]. |
|
YEAR
A year - all full days of a year [01.01.???? |
|
| Method Summary | |
|---|---|
long |
approximateSplitSize(Duration duration)
Calculates the approximate split size for the given Duration if split by the Period. |
static long |
approximateSplitSize(Duration duration, Period period)
Calculates the approximate split size for the given Duration if split by the given Period. |
static Duration |
getDuration(Period period,
long millis)
Calculates a Duration representing the given period and
containing the given reference date. |
java.lang.Integer |
getOrder()
Returns the order. |
java.lang.String |
getValue()
Returns the string value. |
boolean |
isLonger(Period period)
Checks whether the given Period is contained by the Period. |
static Duration |
scrollDuration(Duration duration, Period period, Period.Scroll scroll)
Scrolls the given Duration by the given Period to the
given Scroll direction. |
static Duration |
scrollDurationLevelled(Duration duration, Period period, Period.Scroll scroll)
Scrolls the given Duration by the given Period to the
given Scroll direction and returns a levelled Duration. |
static Period |
valueof(Duration duration)
Returns a Period for a given Duration. |
static Period |
valueof(java.lang.String stringValue)
Returns a Period by its string value. |
static Period |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static Period[] |
values()
Returns an array containing the constants of this enum type, in the order they're declared. |
| Methods inherited from class java.lang.Enum |
|---|
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Enum Constant Detail |
|---|
public static final Period UNDEFINED
Period.
public static final Period SECOND
public static final Period MINUTE
public static final Period HOUR
public static final Period DAY
public static final Period WEEK
public static final Period MONTH
public static final Period YEAR
| Method Detail |
|---|
public static final Period[] values()
for(Period c : Period.values())
System.out.println(c);
public static Period valueOf(java.lang.String name)
name - the name of the enum constant to be returned.
java.lang.IllegalArgumentException - if this enum type has no constant
with the specified namepublic java.lang.String getValue()
public java.lang.Integer getOrder()
public boolean isLonger(Period period)
Period is contained by the Period.
period - the Period to be checked
true
Period contains the given
Periodfalse
Period matches the given
PeriodPeriod is Period.UNDEFINEDPeriod is Period.UNDEFINED
public static Duration getDuration(Period period,
long millis)
Duration representing the given period and
containing the given reference date.
period - the Periodmillis - the reference date in milliseconds
Durationpublic static Duration scrollDuration(Duration duration, Period period, Period.Scroll scroll)
Duration by the given Period to the
given Scroll direction.
duration - the Durationperiod - the Period to scroll byscroll - the scroll direction
Period.UNDEFINED the given
Duration will be left unchangedpublic static Duration scrollDurationLevelled(Duration duration, Period period, Period.Scroll scroll)
Duration by the given Period to the
given Scroll direction and returns a levelled Duration.
Levelled here means the returned Duration will be the
PREVIOUS/NEXT
duration - the Durationperiod - the Period to scroll byscroll - the scroll direction
Period.UNDEFINED the given
Duration will be left unchangedTimeUtilityExceptionpublic static Period valueof(java.lang.String stringValue)
Period by its string value.
stringValue - the string value
Periodpublic static Period valueof(Duration duration)
Period for a given Duration.
duration - the Duration
Periodpublic long approximateSplitSize(Duration duration)
Duration if split by the Period.
duration - the Duration
public static final long approximateSplitSize(Duration duration, Period period)
Duration if split by the given Period.
duration - the Durationperiod - the Period
TimeUtilityException - if the given Period is Period.UNDEFINED
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||