|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.exolab.castor.types.DateTimeBase org.exolab.castor.types.Time
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)
Currently deep support of milli seconds is not implemented. This implementation only support up to 3 figures for milli-seconds.
DateTimeBase
,
Serialized FormField Summary |
Fields inherited from class org.exolab.castor.types.DateTimeBase |
EQUALS, GREATER_THAN, INDETERMINATE, LESS_THAN |
Constructor Summary | |
Time()
|
|
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. |
|
Time(java.lang.String time)
Constructs a Time given a string representation. |
Method Summary | |
short |
getCentury()
|
short |
getDay()
|
void |
getDay(short day)
|
short |
getMonth()
|
void |
getMonth(short month)
|
short[] |
getValues()
returns an array of short with all the fields that describe this time type. |
short |
getYear()
|
void |
getYear(short year)
|
static java.lang.Object |
parse(java.lang.String str)
parses a String and converts it into a java.lang.Object |
static Time |
parseTime(java.lang.String str)
parses a String and converts it into a Time. |
void |
setCentury(short century)
set the century field |
void |
setValues(short[] values)
Sets all the fields by reading the values in an array. |
java.util.Date |
toDate()
converts this Time into a local java Date. |
java.lang.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) |
Methods inherited from class org.exolab.castor.types.DateTimeBase |
addDuration, compareTo, equals, getHour, getMilli, getMinute, getSeconds, getZoneHour, getZoneMinute, hashCode, isLeap, isNegative, isUTC, isZoneNegative, normalize, setDay, setHour, setMilliSecond, setMinute, setMonth, setNegative, setSecond, setSecond, setUTC, setYear, setZone, setZoneHour, setZoneMinute, setZoneNegative, toCalendar |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Time()
public Time(short[] values)
values
- an array of shorts that represent the different fields of Time.public Time(long l)
public Time(java.lang.String time) throws java.text.ParseException
time
- the string representation of the Time to instantiateMethod Detail |
public void setValues(short[] values)
if a Time Zone is specificied it has to be set by using
setZone
.
setValues
in class DateTimeBase
values
- an array of shorts with the values
the array is supposed to be of length 4 and ordered like that:
public short[] getValues()
Note:the time zone is not included.
getValues
in class DateTimeBase
public java.util.Date toDate()
toDate
in class DateTimeBase
public java.lang.String toString()
public static java.lang.Object parse(java.lang.String str) throws java.text.ParseException
str
- the string to parse
java.text.ParseException
- a parse exception is thrown if the string to parse
does not follow the rigth format (see the description
of this class)public static Time parseTime(java.lang.String str) throws java.text.ParseException
str
- the string to parse
java.text.ParseException
- a parse exception is thrown if the string to parse
does not follow the rigth format (see the description
of this class)public short getCentury()
getCentury
in class DateTimeBase
public short getYear()
getYear
in class DateTimeBase
public short getMonth()
getMonth
in class DateTimeBase
public short getDay()
getDay
in class DateTimeBase
public void setCentury(short century)
DateTimeBase
setCentury
in class DateTimeBase
century
- the value to set uppublic void getYear(short year)
public void getMonth(short month)
public void getDay(short day)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |