|
© 2005 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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 | |
Object |
clone()
Returns a copy of this Time. |
int |
compareTo(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(Date date)
Given a java.util.Date, returns a Time instance. |
static Time |
createTime(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(String time)
Given a string of the form hh:mm:ss.sss, returns a Time instance. |
static Time |
createTime(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. |
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(TimeZone timeZone)
Sets the time zone |
Time |
toSQLTime()
Returns a java.sql.Date equivalent. |
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 Object clone()
public int compareTo(Object anotherObject)
compareTo
in interface Comparable
ClassCastException
- thrown if the argument is not an
instance of Time.public int compareTo(Time anotherTime)
anotherTime
- another Time object to be compared.
IllegalArgumentException
- thrown when the argument is
represented in a different time zone from the current time
instant.public static Time createTime()
public static Time createTime(Date date)
date
- date
public static Time createTime(Date date)
date
- date
public static Time createTime(double time)
time
- value of milliseconds since 00:00:00 GMT
public static Time createTime(String time) throws ParseException
Given a string of the form hh:mm:ss.sss, returns a Time instance.
The argument may optionally contain the time zone.
ParseException
- thrown due to illegal string argumentpublic static Time createTime(Timestamp timestamp)
timestamp
- timestamp
public int getHour()
public int getMinute()
public double getSecond()
public double getTime()
public TimeZone getTimeZone()
public boolean isTimeZoneUTC()
public void setHour(int hour) throws IllegalArgumentException
hour
- the hour
IllegalArgumentException
- thrown when the hour argument is illegalpublic void setMinute(int minute) throws IllegalArgumentException
minute
- the minute
IllegalArgumentException
- thrown when the minute argument is illegalpublic void setSecond(double second) throws IllegalArgumentException
second
- the second
IllegalArgumentException
- thrown when the second argument is illegalpublic 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(TimeZone timeZone)
timeZone
- an instance java.util.TimeZonepublic Time toSQLTime()
Returns a java.sql.Date
equivalent. Note that
this operation excludes any timezone.
public String toString()
Returns a XML schema compliant time string.
The method does not guarantee Time.createTime(_string).toString().equals(_string) to be true.
public Time toUTC()
|
© 2005 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |