org.exolab.castor.types
Class Time
- Cloneable, java.io.Serializable
Describes an XML schema Time.
The format is defined by W3C XML Schema Recommendation and ISO8601 i.e
hh:mm:ss.sss(Z|(+|-)hh:mm)
Deep support of fractional seconds is not implemented. This implementation
only supports fractional second resolution of milliseconds.
Time()- No-arg constructor.
|
Time(String time)- Constructs a Time given a string representation.
|
Time(long l)- Constructs a XML Schema Time instance given a long representing the time in milliseconds.
|
Time(short[] values)- Constructs a XML Schema Time instance given all the values of
the different fields.
|
addDuration, appendDateString, appendTimeString, appendTimeZoneString, clone, compareTo, equal, equals, getCentury, getDay, getHour, getMilli, getMinute, getMonth, getSeconds, getValues, getYear, getZoneHour, getZoneMinute, hasCentury, hasDay, hasHour, hasIsNegative, hasMilli, hasMinute, hasMonth, hasSeconds, hasYear, hashCode, isLeap, isNegative, isUTC, isZoneNegative, normalize, parseDay, parseMonth, parseTime, parseTimeZone, parseYear, setCentury, setDateFormatTimeZone, setDateFormatTimeZone, setDay, setHour, setMilliSecond, setMinute, setMonth, setNegative, setSecond, setSecond, setUTC, setValues, setYear, setZone, setZoneHour, setZoneMinute, setZoneNegative, toCalendar, toDate |
Time
public Time()
No-arg constructor.
Time
public Time(String time)
throws ParseException Constructs a Time given a string representation.
time - the string representation of the Time to instantiate
Time
public Time(long l)
Constructs a XML Schema Time instance given a long representing the time in milliseconds.
By default a Time is not UTC and is local.
l - The long value that represents the time instance.
Time
public Time(short[] values)
Constructs a XML Schema Time instance given all the values of
the different fields.
By default a Time is not UTC and is local.
values - an array of shorts that represent the different fields of Time.
getValues
public short[] getValues()
returns an array of short with all the fields that describe
this time type.
Note:the time zone is not included.
- getValues in interface DateTimeBase
- an array of short with all the fields that describe
this time type.
parse
public static Object parse(String str)
throws ParseException parses a String and converts it into a java.lang.Object
str - the string to parse
- the java.lang.Object represented by the string
parseTime
public static Time parseTime(String str)
throws ParseException parses a String and converts it into a Time.
str - the string to parse
- the Time represented by the string
setValues
public void setValues(short[] values)
Sets all the fields by reading the values in an array.
if a Time Zone is specified it has to be set by using
setZone.
- setValues in interface DateTimeBase
values - an array of shorts with the values the array is supposed to be
of length 4 and ordered like that:
- hour
- minute
- second
- millisecond
toDate
public Date toDate()
converts this Time into a local java Date.
- toDate in interface DateTimeBase
- a local date representing this Time
toString
public String toString()
convert this Time to a string
The format is defined by W3C XML Schema Recommendation and ISO8601
i.e hh:mm:ss.sss(Z|(+|-)hh:mm)
- a string representing this Time
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com