edu.cmu.andrew.icalendar
Class DateType

java.lang.Object
  |
  +--edu.cmu.andrew.icalendar.DateType

public final class DateType
extends Object

Enumerated type representing the different ways of representing DATE-TIME objects in iCalendar.

Author:
leg

Field Summary
static DateType DATE
           
static DateType DATE_TIME
           
static DateType DATE_TIME_UTC
           
private  String name
           
private  SimpleDateFormat sdf
           
private static TimeZone UTC_TZ
           
 
Constructor Summary
private DateType(String name, String format, boolean localtime)
           
 
Method Summary
 String format(Date date)
          Given the Date object, format it according to this datespec.
 Date parse(String text)
          Parse the given date with this datespec.
 String toString()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

name

private final String name

sdf

private final SimpleDateFormat sdf

UTC_TZ

private static final TimeZone UTC_TZ

DATE_TIME_UTC

public static final DateType DATE_TIME_UTC

DATE_TIME

public static final DateType DATE_TIME

DATE

public static final DateType DATE
Constructor Detail

DateType

private DateType(String name,
                 String format,
                 boolean localtime)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

parse

public Date parse(String text)
Parse the given date with this datespec.
Parameters:
text - the String representation of the date.
Returns:
the Date object parsed, or null if this datespec doesn't parse it.

format

public String format(Date date)
Given the Date object, format it according to this datespec.
Parameters:
date -  
Returns:
the string format of this argument