|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectwicket.util.value.LongValue
wicket.util.time.TimeOfDay
public final class TimeOfDay
An immutable time of day value represented as milliseconds since the most recent midnight.
Values can be constructed using various factory methods:
If an attempt is made to construct an illegal time of day value (one that is greater than 24 hours worth of milliseconds), an IllegalArgumentException will be thrown.
Military hours, minutes and seconds of the time of day can be retrieved by calling hour(), minute() and second().
The next occurrence of a given time of day can be retrieved by calling next() or next(Calendar).
| Nested Class Summary | |
|---|---|
static class |
TimeOfDay.Meridian
Typesafe AM/PM enumeration. |
| Field Summary | |
|---|---|
static TimeOfDay.Meridian |
AM
Constant for AM time. |
static TimeOfDay |
MIDNIGHT
Constant for midnight. |
static TimeOfDay |
NOON
Constant for noon. |
static TimeOfDay.Meridian |
PM
Constant for PM time. |
| Fields inherited from class wicket.util.value.LongValue |
|---|
value |
| Method Summary | |
|---|---|
boolean |
after(wicket.util.time.AbstractTimeValue that)
|
boolean |
before(wicket.util.time.AbstractTimeValue that)
|
long |
getMilliseconds()
|
int |
hour()
Gets the hour of the day. |
static TimeOfDay |
militaryTime(int hour,
int minute,
int second)
Gets a time of day value on a 24 hour clock. |
int |
minute()
Gets the minute. |
Time |
next()
Gets the next occurrence of this time of day in localtime. |
Time |
next(java.util.Calendar calendar)
Gets the next occurence of this time of day on the given calendar. |
static TimeOfDay |
now()
Gets the time of day it is now. |
static TimeOfDay |
now(java.util.Calendar calendar)
Gets the time of day it is now on the given calendar. |
int |
second()
Gets the second. |
static TimeOfDay |
time(int hour,
int minute,
int second,
TimeOfDay.Meridian meridian)
Gets a time of day on a 12 hour clock. |
static TimeOfDay |
time(int hour,
int minute,
TimeOfDay.Meridian meridian)
Gets a time of day on a 12 hour clock. |
java.lang.String |
toString()
Converts this time to a string suitable for use in a filesystem name |
java.lang.String |
toTimeString()
Converts this time to a time string using the formatter h.mma |
java.lang.String |
toTimeString(java.util.Calendar calendar)
Converts this time to a date string using the date formatter h.mma |
static TimeOfDay |
valueOf(java.util.Calendar calendar,
java.lang.String time)
Converts to TimeOfDay instance. |
static TimeOfDay |
valueOf(java.util.Calendar calendar,
Time time)
Converts to TimeOfDay instance. |
static TimeOfDay |
valueOf(Duration duration)
Converts to TimeOfDay instance. |
static TimeOfDay |
valueOf(long time)
Converts to TimeOfDay instance. |
static TimeOfDay |
valueOf(java.lang.String time)
Converts to TimeOfDay instance. |
static TimeOfDay |
valueOf(Time time)
Converts to TimeOfDay instance. |
| Methods inherited from class wicket.util.value.LongValue |
|---|
compareTo, equals, greaterThan, greaterThan, hashCode, lessThan, lessThan |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final TimeOfDay.Meridian AM
public static final TimeOfDay MIDNIGHT
public static final TimeOfDay.Meridian PM
public static final TimeOfDay NOON
| Method Detail |
|---|
public static TimeOfDay militaryTime(int hour,
int minute,
int second)
hour - The hour (0-23)minute - The minute (0-59)second - The second (0-59)
public static TimeOfDay now()
public static TimeOfDay now(java.util.Calendar calendar)
calendar - The calendar to use
public static TimeOfDay time(int hour,
int minute,
int second,
TimeOfDay.Meridian meridian)
hour - The hour (1-12)minute - The minute (0-59)second - The second (0-59)meridian - AM/PM
public static TimeOfDay time(int hour,
int minute,
TimeOfDay.Meridian meridian)
hour - The hour (1-12)minute - The minute (0-59)meridian - AM/PM
public static TimeOfDay valueOf(java.util.Calendar calendar,
java.lang.String time)
throws java.text.ParseException
calendar - The calendar to use when parsing time stringtime - A string in h.mma format
java.text.ParseException
public static TimeOfDay valueOf(java.util.Calendar calendar,
Time time)
calendar - The calendar to use when converting time valuetime - The time to convert to a time of day
public static TimeOfDay valueOf(Duration duration)
duration - The duration
public static TimeOfDay valueOf(long time)
time - The time in milliseconds today
public static TimeOfDay valueOf(java.lang.String time)
throws java.text.ParseException
time - A string in h.mma format
java.text.ParseExceptionpublic static TimeOfDay valueOf(Time time)
time - Time to convert to time of day
public int hour()
public int minute()
public Time next()
public Time next(java.util.Calendar calendar)
calendar - The calendar to use
public int second()
public java.lang.String toString()
Object.toString()public final boolean after(wicket.util.time.AbstractTimeValue that)
that - The time to compare with
public final boolean before(wicket.util.time.AbstractTimeValue that)
that - The time to compare with
public final java.lang.String toTimeString()
public final java.lang.String toTimeString(java.util.Calendar calendar)
calendar - The calendar to use in the conversion
public final long getMilliseconds()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||