Spec-Zone .ru
спецификации, руководства, описания, API
|
|
JavaTM 2 Platform Std. Ed. v1.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Date | +--java.sql.Time
A thin wrapper around java.util.Date
that allows
JDBC to identify this as a SQL TIME
value. The Time
class adds formatting and
parsing operations to support the JDBC escape syntax for time
values.
The date components should be set to the "zero epoch" value of January 1, 1970 and should not be accessed.
Constructor Summary | |
Time(int hour,
int minute,
int second)
Deprecated. Use the constructor that takes a milliseconds value in place of this constructor |
|
Time(long time)
Constructs a Time object using a milliseconds time value. |
Method Summary | |
int |
getDate()
Deprecated. |
int |
getDay()
Deprecated. |
int |
getMonth()
Deprecated. |
int |
getYear()
Deprecated. |
void |
setDate(int i)
Deprecated. |
void |
setMonth(int i)
Deprecated. |
void |
setTime(long time)
Sets a Time object using a milliseconds time value. |
void |
setYear(int i)
Deprecated. |
String |
toString()
Formats a time in JDBC date escape format |
static Time |
valueOf(String s)
Converts a string in JDBC time escape format to a Time value. |
Methods inherited from class java.util.Date |
after, before, clone, compareTo, compareTo, equals, getHours, getMinutes, getSeconds, getTime, getTimezoneOffset, hashCode, parse, setHours, setMinutes, setSeconds, toGMTString, toLocaleString, UTC |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Time(int hour, int minute, int second)
Time
object initialized with the
given values for the hour, minute, and second.
The driver sets the date components to January 1, 1970.
Any method that attempts to access the date components of a
Time
object will throw a
java.lang.IllegalArgumentException
.hour
- 0 to 23minute
- 0 to 59second
- 0 to 59public Time(long time)
Time
object using a milliseconds time value.time
- milliseconds since January 1, 1970, 00:00:00 GMT;
a negative number is milliseconds before
January 1, 1970, 00:00:00 GMTMethod Detail |
public void setTime(long time)
Time
object using a milliseconds time value.setTime
in class Date
time
- milliseconds since January 1, 1970, 00:00:00 GMT;
a negative number is milliseconds before
January 1, 1970, 00:00:00 GMTpublic static Time valueOf(String s)
Time
value.s
- time in format "hh:mm:ss"Time
objectpublic String toString()
toString
in class Date
String
in hh:mm:ss formatpublic int getYear()
TIME
values do not have a year component.getYear
in class Date
IllegalArgumentException
- if this
method is invokedpublic int getMonth()
TIME
values do not have a month component.getMonth
in class Date
IllegalArgumentException
- if this
method is invokedpublic int getDay()
TIME
values do not have a day component.getDay
in class Date
IllegalArgumentException
- if this
method is invokedpublic int getDate()
TIME
values do not have a date component.getDate
in class Date
IllegalArgumentException
- if this
method is invokedpublic void setYear(int i)
TIME
values do not have a year component.setYear
in class Date
IllegalArgumentException
- if this
method is invokedpublic void setMonth(int i)
TIME
values do not have a month component.setMonth
in class Date
IllegalArgumentException
- if this
method is invokedpublic void setDate(int i)
TIME
values do not have a date component.setDate
in class Date
IllegalArgumentException
- if this
method is invoked
|
JavaTM 2 Platform Std. Ed. v1.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.