| wicket.util.time.AbstractTimeValue wicket.util.time.AbstractTime wicket.util.time.TimeOfDay
TimeOfDay | final public class TimeOfDay extends AbstractTime (Code) | | An immutable time of day value represented as milliseconds since the most
recent midnight.
Values can be constructed using various factory methods:
- valueOf(long) where long is milliseconds since midnight
- valueOf(String) where the string is in h.mma format
- valueOf(Calendar, String) where the string is in h.mma format
- valueOf(Duration) where duration is time since midnight
- valueOf(Time) where time is some point in time today
- valueOf(Calendar, Time) where time is some point in time today
- militaryTime(int hour, int minute, int second) for 24 hour time
- time(int hour, int minute, Meridian) where Meridian is AM or PM
- time(int hour, int minute, int second, Meridian) where Meridian is AM or
PM
- now() to construct the current time of day
- now(Calendar) to construct the current time of day using a given
calendar
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).
author: Jonathan Locke |
Inner Class :final public static class Meridian extends EnumeratedType | |
Field Summary | |
final public static Meridian | AM Constant for AM time. | final public static TimeOfDay | MIDNIGHT Constant for midnight. | final public static TimeOfDay | NOON Constant for noon. | final public static Meridian | PM Constant for PM time. |
AM | final public static Meridian AM(Code) | | Constant for AM time.
|
MIDNIGHT | final public static TimeOfDay MIDNIGHT(Code) | | Constant for midnight.
|
PM | final public static Meridian PM(Code) | | Constant for PM time.
|
hour | public int hour()(Code) | | Gets the hour of the day.
The hour of the day (0-23) |
militaryTime | public static TimeOfDay militaryTime(int hour, int minute, int second)(Code) | | Gets a time of day value on a 24 hour clock.
Parameters: hour - The hour (0-23) Parameters: minute - The minute (0-59) Parameters: second - The second (0-59) The time of day |
minute | public int minute()(Code) | | Gets the minute.
The minute (0-59) |
next | public Time next()(Code) | | Gets the next occurrence of this time of day in localtime.
The next occurrence of this time of day in localtime |
next | public Time next(Calendar calendar)(Code) | | Gets the next occurence of this time of day on the given calendar.
Parameters: calendar - The calendar to use The next occurrence of this time of day on the given calendar |
now | public static TimeOfDay now()(Code) | | Gets the time of day it is now.
The time of day it is now |
now | public static TimeOfDay now(Calendar calendar)(Code) | | Gets the time of day it is now on the given calendar.
Parameters: calendar - The calendar to use The time of day it is now on the given calendar |
second | public int second()(Code) | | Gets the second.
The second (0-59) |
time | public static TimeOfDay time(int hour, int minute, int second, Meridian meridian)(Code) | | Gets a time of day on a 12 hour clock.
Parameters: hour - The hour (1-12) Parameters: minute - The minute (0-59) Parameters: second - The second (0-59) Parameters: meridian - AM/PM The time value |
time | public static TimeOfDay time(int hour, int minute, Meridian meridian)(Code) | | Gets a time of day on a 12 hour clock.
Parameters: hour - The hour (1-12) Parameters: minute - The minute (0-59) Parameters: meridian - AM/PM The time value |
valueOf | public static TimeOfDay valueOf(Calendar calendar, String time) throws ParseException(Code) | | Converts to TimeOfDay instance.
Parameters: calendar - The calendar to use when parsing time string Parameters: time - A string in h.mma format The time of day on the given calendar throws: ParseException - |
valueOf | public static TimeOfDay valueOf(Calendar calendar, Time time)(Code) | | Converts to TimeOfDay instance.
Parameters: calendar - The calendar to use when converting time value Parameters: time - The time to convert to a time of day The time of day for this time |
valueOf | public static TimeOfDay valueOf(Duration duration)(Code) | | Converts to TimeOfDay instance.
Parameters: duration - The duration The time of day for the duration since midnight |
valueOf | public static TimeOfDay valueOf(long time)(Code) | | Converts to TimeOfDay instance.
Parameters: time - The time in milliseconds today The time of day |
valueOf | public static TimeOfDay valueOf(Time time)(Code) | | Converts to TimeOfDay instance.
Parameters: time - Time to convert to time of day The time of day in the current timezone |
Methods inherited from wicket.util.time.AbstractTimeValue | final public long getMilliseconds()(Code)(Java Doc)
|
|
|