|
© 2002 BEA Systems, Inc. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--com.bea.p13n.xml.schema.Time
This class provides the Java binding for the XML schema type time as specified in Section 3.2.25 of XML Schema Part 2: Datatypes.
time represents a specific instant of a time that recurs every day.
Example: 09:00:00.0005.
Instances of this type can be constructed from valid instances of time strings and java.sql.Time.
| Field Summary | |
protected RecurringDuration |
_internal
|
| Constructor Summary | |
protected |
Time()
Constructs a new Time instance. |
| Method Summary | |
java.lang.Object |
clone()
Returns a copy of this Time. |
int |
compareTo(java.lang.Object anotherObject)
Compares this Time with another object. |
int |
compareTo(Time anotherTime)
Compares this Time to another Time object (represented in the same time zone) in their canonical representation. |
static Time |
createTime()
Returns a Time instance for the current time at the local time zone. |
static Time |
createTime(java.util.Date date)
Given a java.util.Date, returns a Time instance. |
static Time |
createTime(java.sql.Date date)
Given a java.sql.Date, returns a Time instance. |
static Time |
createTime(double time)
Given the value of milliseconds since the 00:00:00 GMT, returns a Time. |
static Time |
createTime(java.lang.String time)
Given a string of the form hh:mm:ss.sss, returns a Time instance. |
static Time |
createTime(java.sql.Timestamp timestamp)
Given a java.util.Timestamp, returns a Time instance. |
int |
getHour()
Returns the hour (hh) field |
int |
getMinute()
Returns the minute (mm) field |
double |
getSecond()
Returns the second (ss.sss) field |
double |
getTime()
Returns the value of milliseconds since 00:00:00 GMT represented by this time instant object. |
java.util.TimeZone |
getTimeZone()
Returns the time zone |
boolean |
isTimeZoneUTC()
Returns true if the time instant is based on UTC |
void |
setHour(int hour)
Sets the hour (hh) field |
void |
setMinute(int minute)
Sets the minute (mm) field |
void |
setSecond(double second)
Sets the second (ss.sss) field |
void |
setTimeZone(int zoneHour,
int zoneMinute)
Sets the time zone |
void |
setTimeZone(java.util.TimeZone timeZone)
Sets the time zone |
java.sql.Time |
toSQLTime()
Returns a java.sql.Date equivalent. |
java.lang.String |
toString()
Returns a XML schema compliant time string. |
Time |
toUTC()
Offsets the current time instant to UTC. |
| Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
| Field Detail |
protected RecurringDuration _internal
| Constructor Detail |
protected Time()
| Method Detail |
public static Time createTime()
public static Time createTime(java.lang.String time)
throws java.text.ParseException
Given a string of the form hh:mm:ss.sss, returns a Time instance.
The argument may optionally contain the time zone.
String - representation of XML schema timepublic static Time createTime(java.util.Date date)
date - datepublic static Time createTime(java.sql.Date date)
date - datepublic static Time createTime(java.sql.Timestamp timestamp)
timestamp - timestamppublic static Time createTime(double time)
time - value of milliseconds since 00:00:00 GMTpublic java.lang.Object clone()
public int compareTo(Time anotherTime)
anotherTime - another Time object to be compared.public int compareTo(java.lang.Object anotherObject)
object - the object to be comparedpublic int getHour()
public void setHour(int hour)
throws java.lang.IllegalArgumentException
hour - the hourpublic int getMinute()
public void setMinute(int minute)
throws java.lang.IllegalArgumentException
minute - the minutepublic double getSecond()
public void setSecond(double second)
throws java.lang.IllegalArgumentException
second - the second
public void setTimeZone(int zoneHour,
int zoneMinute)
zoneHour - the hour field of timeZone. Can be negative to
indicate negative offset.zoneMinute - the minute field of timeZonepublic void setTimeZone(java.util.TimeZone timeZone)
timeZone - an instance java.util.TimeZonepublic java.util.TimeZone getTimeZone()
public boolean isTimeZoneUTC()
public java.lang.String toString()
Returns a XML schema compliant time string.
The method does not guarantee Time.createTime(_string).toString().equals(_string) to be true.
public double getTime()
public Time toUTC()
public java.sql.Time toSQLTime()
Returns a java.sql.Date equivalent. Note that
this operation excludes any timezone.
|
© 2002 BEA Systems, Inc. | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||