public class ZonelessTime extends ZonelessDatetime
| Modifier and Type | Field and Description |
|---|---|
protected int |
precision |
protected Time |
tempTime |
internalTime, lastFormat, tempCal, tempFormatter| Constructor and Description |
|---|
ZonelessTime()
Constructs a ZonelessTime
|
ZonelessTime(int precision)
Constructs a ZonelessTime with precision.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getJdbcTimestamp(TimeZone zone)
Override ZonelessDatetime.
|
protected Time |
getTempTime(long value)
Gets a temporary Time object.
|
static ZonelessTime |
parse(String s)
Parses a string as a ZonelessTime.
|
static ZonelessTime |
parse(String s,
String format)
Parses a string as a ZonelessTime using a given format string.
|
void |
setZonedTime(long value,
TimeZone zone)
Sets this datetime via a zoned time value.
|
void |
setZonelessTime(long value)
Sets this datetime via a zoneless time value.
|
Object |
toJdbcObject()
Returns this datetime as a Jdbc object
|
String |
toString()
Converts this ZonelessTime to a java.sql.Time and formats it via the
toString() method of that class. |
String |
toString(String format)
Formats this ZonelessTime via a SimpleDateFormat
|
clearDate, clearTime, getCalendar, getDateValue, getFormatter, getJdbcDate, getJdbcTime, getTime, getTimeValueprotected final int precision
protected transient Time tempTime
public ZonelessTime()
public ZonelessTime(int precision)
The precision is the number of digits to the right of the decimal
point in the seconds value. For example, a TIME(6) has a
precision to microseconds.
precision - Number of digits of precisionpublic void setZonelessTime(long value)
BasicDatetimesetZonelessTime in interface BasicDatetimesetZonelessTime in class ZonelessDatetimepublic void setZonedTime(long value,
TimeZone zone)
BasicDatetimesetZonedTime in interface BasicDatetimesetZonedTime in class ZonelessDatetimepublic Object toJdbcObject()
ZonelessDatetimetoJdbcObject in class ZonelessDatetimepublic long getJdbcTimestamp(TimeZone zone)
NOTE: the returned timestamp is based on the current date of the specified time zone, rather than the context variable for current_date, as specified by the SQL standard.
getJdbcTimestamp in class ZonelessDatetimezone - time zone in which to generate a time value forpublic String toString()
toString() method of that class.public String toString(String format)
format - format string, as required by SimpleDateFormatpublic static ZonelessTime parse(String s)
s - a string representing a time in ISO format, i.e. according to
the SimpleDateFormat string "HH:mm:ss"public static ZonelessTime parse(String s, String format)
s - a string representing a time the given formatformat - format string as per SimpleDateFormatprotected Time getTempTime(long value)
Copyright © 2012–2015 The Apache Software Foundation. All rights reserved.