Public Member Functions | Static Public Member Functions

org.exolab.castor.types.Time Class Reference

Inheritance diagram for org.exolab.castor.types.Time:
org.exolab.castor.types.DateTimeBase

List of all members.

Public Member Functions

 Time ()
 Time (short[] values)
 Time (long l)
 Time (String time) throws ParseException
void setValues (short[] values)
short[] getValues ()
Date toDate ()
String toString ()
short getCentury ()
short getYear ()
short getMonth ()
short getDay ()
void setCentury (short century)
void getYear (short year)
void getMonth (short month)
void getDay (short day)

Static Public Member Functions

static Object parse (String str) throws ParseException
static Time parseTime (String str) throws ParseException

Detailed Description

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.

Author:
Arnaud Blandin
Version:
Revision:
1.1.1.1
See also:
DateTimeBase

Constructor & Destructor Documentation

org.exolab.castor.types.Time.Time (  ) 
org.exolab.castor.types.Time.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.

Parameters:
values an array of shorts that represent the different fields of Time.

References org.exolab.castor.types.Time.setValues().

org.exolab.castor.types.Time.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.

Parameters:
the long value that represents the time instance.

References org.exolab.castor.types.DateTimeBase.setHour(), org.exolab.castor.types.DateTimeBase.setMinute(), and org.exolab.castor.types.DateTimeBase.setSecond().

org.exolab.castor.types.Time.Time ( String  time  )  throws ParseException

Constructs a Time given a string representation.

Parameters:
time the string representation of the Time to instantiate

Member Function Documentation

short org.exolab.castor.types.Time.getCentury (  ) 
short org.exolab.castor.types.Time.getDay (  ) 
void org.exolab.castor.types.Time.getDay ( short  day  ) 
short org.exolab.castor.types.Time.getMonth (  ) 
void org.exolab.castor.types.Time.getMonth ( short  month  ) 
short [] org.exolab.castor.types.Time.getValues (  )  [virtual]

returns an array of short with all the fields that describe this time type.

Note:the time zone is not included.

Returns:
an array of short with all the fields that describe this time type.

Implements org.exolab.castor.types.DateTimeBase.

References org.exolab.castor.types.DateTimeBase.getHour(), org.exolab.castor.types.DateTimeBase.getMilli(), org.exolab.castor.types.DateTimeBase.getMinute(), and org.exolab.castor.types.DateTimeBase.getSeconds().

short org.exolab.castor.types.Time.getYear (  ) 
void org.exolab.castor.types.Time.getYear ( short  year  ) 
static Object org.exolab.castor.types.Time.parse ( String  str  )  throws ParseException [static]

parses a String and converts it into a java.lang.Object

Parameters:
str the string to parse
Returns:
the java.lang.Object represented by the string
Exceptions:
ParseException a parse exception is thrown if the string to parse does not follow the rigth format (see the description of this class)

References org.exolab.castor.types.Time.parseTime().

static Time org.exolab.castor.types.Time.parseTime ( String  str  )  throws ParseException [static]

parses a String and converts it into a Time.

Parameters:
str the string to parse
Returns:
the Time represented by the string
Exceptions:
ParseException a parse exception is thrown if the string to parse does not follow the rigth format (see the description of this class)

References org.exolab.castor.types.Time.Time().

Referenced by org.exolab.castor.types.Time.parse().

void org.exolab.castor.types.Time.setCentury ( short  century  ) 

set the century field

Parameters:
century the value to set up

Reimplemented from org.exolab.castor.types.DateTimeBase.

void org.exolab.castor.types.Time.setValues ( short[]  values  )  [virtual]

Sets all the fields by reading the values in an array.

if a Time Zone is specificied it has to be set by using setZone.

Parameters:
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

Implements org.exolab.castor.types.DateTimeBase.

References org.exolab.castor.types.DateTimeBase.setHour(), org.exolab.castor.types.DateTimeBase.setMinute(), and org.exolab.castor.types.DateTimeBase.setSecond().

Referenced by org.exolab.castor.types.Time.Time().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties