|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TimeFactory
Factory for creating Time
objects.
Method Summary | |
---|---|
Time |
create(DayDate date,
TimeOfDay timeOfDay)
Creates a new Time instance representing the given time of day
of the given date. |
Time |
deserialize(String time)
Creates a new Time object with time of the given string
serialization, as returned by Time.serialize() |
Time |
fromJavaUtilDate(Date date)
Converts a Date to a Time object, using the
default time zone. |
Time |
fromJavaUtilDate(Date date,
TimeZone timeZone)
Converts a Date to a Time object, using the
given time zone. |
Time |
fromLong(long time)
Converts a long , as returned from Time.toLong() to
a Time object. |
Time |
getDefault()
Returns a default time value: 1970-01-01 00:00:00.000 (the UNIX epoch time). |
Time |
now()
|
Time |
parse(DayDate date,
int hour,
int minute,
int second)
Creates a new Time object, if possible, from the given
parameters. |
Time |
parse(DayDate date,
int hour,
int minute,
int second,
int millis)
Creates a new Time object, if possible, from the given
parameters. |
Time |
parse(DayDate date,
String hour,
String minute,
String second)
Creates a new Time object, if possible, from the given
parameters. |
Time |
parse(DayDate date,
String hour,
String minute,
String second,
String millis)
Creates a new Time object, if possible, from the given
parameters. |
Time |
parse(int year,
int month,
int day,
int hour,
int minute,
int second)
Creates a new Time object, if possible, from the given
parameters. |
Time |
parse(int year,
int month,
int day,
int hour,
int minute,
int second,
int millis)
Creates a new Time object, if possible, from the given
parameters. |
Time |
parse(String time)
Creates a new Time object, if possible, from the given
representation. |
Time |
parse(String date,
int hour,
int minute,
int second)
Creates a new Time object, if possible, from the given
parameters. |
Time |
parse(String date,
int hour,
int minute,
int second,
int millis)
Creates a new Time object, if possible, from the given
parameters. |
Time |
parse(String date,
String hour,
String minute,
String second)
Creates a new Time object, if possible, from the given
parameters. |
Time |
parse(String date,
String hour,
String minute,
String second,
String millis)
Creates a new Time object, if possible, from the given
parameters. |
Time |
parse(String year,
String month,
String day,
String hour,
String minute,
String second)
Creates a new Time object, if possible, from the given
parameters. |
Time |
parse(String year,
String month,
String day,
String hour,
String minute,
String second,
String millis)
Creates a new Time object, if possible, from the given
parameters. |
Time |
parse(String date,
TimeOfDay timeOfDay)
Creates a new Time object, if possible, from the given
parameters. |
Time |
unpack(long time)
Converts a long , as returned from Time.pack() to a
Time object. |
Time |
utc()
|
Method Detail |
---|
Time now()
Time utc()
Time getDefault()
null
values.
Time create(DayDate date, TimeOfDay timeOfDay)
Time
instance representing the given time of day
of the given date.
date
- The date.timeOfDay
- The time of day.
Time deserialize(String time) throws IllegalArgumentException
Time
object with time of the given string
serialization, as returned by Time.serialize()
time
- The string serialization of the time, on the format
YYYYMMDDhhmmssnnn
, where nnn
is the
milliseconds.
IllegalArgumentException
- If the given string serialization does
not represent a correct timestamp.Time parse(String year, String month, String day, String hour, String minute, String second)
Time
object, if possible, from the given
parameters. If the given parameters do not represent a correct time,
null
is returned. This is the case even if the parameters
are totally wrong (i.e. not number, out of range, null etc etc) - no
exception is ever thrown.
The millisecond of the time is set to 0.
year
- The year in the range 1000-9999.month
- The month in the range 1-12.day
- The day in the range 1-28, 1-29, 1-30 or 1-31 depending on
month and year.hour
- The hour in the range 0-23.minute
- The minute in the range 0-59.second
- The second in the range 0-59.
null
if the provided parameters
do not represent a correct time.Time parse(int year, int month, int day, int hour, int minute, int second)
Time
object, if possible, from the given
parameters. If the given parameters do not represent a correct time,
null
is returned. This is the case even if the parameters
are totally wrong (i.e. out of range, null etc etc) - no exception is
ever thrown.
The millisecond of the time is set to 0.
year
- The year in the range 1000-9999.month
- The month in the range 1-12.day
- The day in the range 1-28, 1-29, 1-30 or 1-31 depending on
month and year.hour
- The hour in the range 0-23.minute
- The minute in the range 0-59.second
- The second in the range 0-59.
null
if the provided parameters
do not represent a correct time.Time parse(String year, String month, String day, String hour, String minute, String second, String millis)
Time
object, if possible, from the given
parameters. If the given parameters do not represent a correct time,
null
is returned. This is the case even if the parameters
are totally wrong (i.e. not number, out of range, null etc etc) - no
exception is ever thrown.
year
- The year in the range 1000-9999.month
- The month in the range 1-12.day
- The day in the range 1-28, 1-29, 1-30 or 1-31 depending on
month and year.hour
- The hour in the range 0-23.minute
- The minute in the range 0-59.second
- The second in the range 0-59.millis
- The millisecond in the range 0-999.
null
if the provided parameters
do not represent a correct time.Time parse(int year, int month, int day, int hour, int minute, int second, int millis)
Time
object, if possible, from the given
parameters. If the given parameters do not represent a correct time,
null
is returned. This is the case even if the parameters
are totally wrong (i.e. out of range, null etc etc) - no exception is
ever thrown.
year
- The year in the range 1000-9999.month
- The month in the range 1-12.day
- The day in the range 1-28, 1-29, 1-30 or 1-31 depending on
month and year.hour
- The hour in the range 0-23.minute
- The minute in the range 0-59.second
- The second in the range 0-59.millis
- The millisecond in the range 0-999.
null
if the provided parameters
do not represent a correct time.Time parse(String date, String hour, String minute, String second)
Time
object, if possible, from the given
parameters. If the given parameters do not represent a correct time,
null
is returned. This is the case even if the parameters
are totally wrong (i.e. not number, out of range, null etc etc) - no
exception is ever thrown.
The millisecond of the time is set to 0.
date
- The date, represented as a string on one of the formats
YYYYMMDD
and YYYY-MM-DD
.hour
- The hour in the range 0-23.minute
- The minute in the range 0-59.second
- The second in the range 0-59.
null
if the provided parameters
do not represent a correct time.Time parse(String date, int hour, int minute, int second)
Time
object, if possible, from the given
parameters. If the given parameters do not represent a correct time,
null
is returned. This is the case even if the parameters
are totally wrong (i.e. not number, out of range, null etc etc) - no
exception is ever thrown.
The millisecond of the time is set to 0.
date
- The date, represented as a string on one of the formats
YYYYMMDD
and YYYY-MM-DD
.hour
- The hour in the range 0-23.minute
- The minute in the range 0-59.second
- The second in the range 0-59.
null
if the provided parameters
do not represent a correct time.Time parse(String date, String hour, String minute, String second, String millis)
Time
object, if possible, from the given
parameters. If the given parameters do not represent a correct time,
null
is returned. This is the case even if the parameters
are totally wrong (i.e. not number, out of range, null etc etc) - no
exception is ever thrown.
date
- The date, represented as a string on one of the formats
YYYYMMDD
and YYYY-MM-DD
.hour
- The hour in the range 0-23.minute
- The minute in the range 0-59.second
- The second in the range 0-59.millis
- The millisecond in the range 0-999.
null
if the provided parameters
do not represent a correct time.Time parse(String date, int hour, int minute, int second, int millis)
Time
object, if possible, from the given
parameters. If the given parameters do not represent a correct time,
null
is returned. This is the case even if the parameters
are totally wrong (i.e. not number, out of range, null etc etc) - no
exception is ever thrown.
date
- The date, represented as a string on one of the formats
YYYYMMDD
and YYYY-MM-DD
.hour
- The hour in the range 0-23.minute
- The minute in the range 0-59.second
- The second in the range 0-59.millis
- The millisecond in the range 0-999.
null
if the provided parameters
do not represent a correct time.Time parse(String date, TimeOfDay timeOfDay)
Time
object, if possible, from the given
parameters. If the given parameters do not represent a correct time,
null
is returned. This is the case even if the parameters
are totally wrong (i.e. not number, out of range, null etc etc) - no
exception is ever thrown.
date
- The date, represented as a string on one of the formats
YYYYMMDD
and YYYY-MM-DD
.timeOfDay
- The time of day.
null
if the provided parameters
do not represent a correct time.Time parse(DayDate date, String hour, String minute, String second)
Time
object, if possible, from the given
parameters. If the given parameters do not represent a correct time,
null
is returned. This is the case even if the parameters
are totally wrong (i.e. not number, out of range, null etc etc) - no
exception is ever thrown.
The millisecond is set to 0.
date
- The date.hour
- The hour in the range 0-23.minute
- The minute in the range 0-59.second
- The second in the range 0-59.
null
if the provided parameters
do not represent a correct time.Time parse(DayDate date, int hour, int minute, int second)
Time
object, if possible, from the given
parameters. If the given parameters do not represent a correct time,
null
is returned. This is the case even if the parameters
are totally wrong (i.e. out of range, null etc etc) - no exception is
ever thrown.
The millisecond is set to 0.
date
- The date.hour
- The hour in the range 0-23.minute
- The minute in the range 0-59.second
- The second in the range 0-59.
null
if the provided parameters
do not represent a correct time.Time parse(DayDate date, String hour, String minute, String second, String millis)
Time
object, if possible, from the given
parameters. If the given parameters do not represent a correct time,
null
is returned. This is the case even if the parameters
are totally wrong (i.e. not number, out of range, null etc etc) - no
exception is ever thrown.
date
- The date.hour
- The hour in the range 0-23.minute
- The minute in the range 0-59.second
- The second in the range 0-59.millis
- The millisecond in the range 0-999.
null
if the provided parameters
do not represent a correct time.Time parse(DayDate date, int hour, int minute, int second, int millis)
Time
object, if possible, from the given
parameters. If the given parameters do not represent a correct time,
null
is returned. This is the case even if the parameters
are totally wrong (i.e. out of range, null etc etc) - no exception is
ever thrown.
date
- The date.hour
- The hour in the range 0-23.minute
- The minute in the range 0-59.second
- The second in the range 0-59.millis
- The millisecond in the range 0-999.
null
if the provided parameters
do not represent a correct time.Time parse(String time)
Time
object, if possible, from the given
representation. If the given representation do not represent a correct
time, null
is returned. This is the case even if the
representation is totally wrong - no exception is ever thrown.
time
- The timestamp, in the format date time
, where
date
is on one of the formats
YYYYMMDD
and YYYY-MM-DD
, and
time
is on one of the formats
hhmmss
, hhmmssnnn
,
hh:mm:ss
, hh:mm:ss.nnn
, where
nnn
is the millisecond.
null
if the provided paramater
does not represent a correct time.Time fromJavaUtilDate(Date date)
Date
to a Time
object, using the
default time zone.
date
- The date to convert.
Time fromJavaUtilDate(Date date, TimeZone timeZone)
Date
to a Time
object, using the
given time zone.
date
- The date to convert.timeZone
- The time zone, or null
to use the default
time zone.
Time fromLong(long time) throws IllegalArgumentException
long
, as returned from Time.toLong()
to
a Time
object.
time
- The long
value.
IllegalArgumentException
- If the given long
value
does not correctly represent a time.Time unpack(long time) throws IllegalArgumentException
long
, as returned from Time.pack()
to a
Time
object.
time
- The long
value.
IllegalArgumentException
- If the given long
value
does not correctly represent a time.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |