org.oddjob.arooa.utils
Class TimeParser

java.lang.Object
  extended by org.oddjob.arooa.utils.TimeParser

public class TimeParser
extends Object

A Parser for time. The format must be either:

The parser provides a Date based on the given Calendar or CalendarAdaptor.

Author:
rob

Constructor Summary
TimeParser()
          Constructor.
TimeParser(Calendar calendar)
          Constructor.
TimeParser(CalendarAdaptor adaptor)
          Constructor.
TimeParser(TimeZone timeZone)
          Constructor.
 
Method Summary
 Date parse(String text)
          Parse the given time string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TimeParser

public TimeParser(CalendarAdaptor adaptor)
Constructor.

Parameters:
adaptor - The adaptor to base the date on.

TimeParser

public TimeParser(Calendar calendar)
Constructor.

Parameters:
calendar - The calendar to base the date on.

TimeParser

public TimeParser(TimeZone timeZone)
Constructor. The date will be base on the current date in the given time zone.

Parameters:
timeZone - The given time zone.

TimeParser

public TimeParser()
Constructor. The date will be base on the current date.

Method Detail

parse

public Date parse(String text)
           throws ParseException
Parse the given time string.

Parameters:
text - The time.
Returns:
The date base on the provided calendar or CalendarAdaptor.
Throws:
ParseException