ezvcard.util
Enum ISOFormat

java.lang.Object
  extended by java.lang.Enum<ISOFormat>
      extended by ezvcard.util.ISOFormat
All Implemented Interfaces:
Serializable, Comparable<ISOFormat>

public enum ISOFormat
extends Enum<ISOFormat>

Represents the various ISO8601 date/time formats that vCard dates can be represented as.

Author:
George El-Haddad, Michael Angstadt

Enum Constant Summary
DATE_BASIC
          Example: 20120701
DATE_EXTENDED
          Example: 2012-07-01
HCARD_TIME_TAG
          Example: 2012-07-01T14:21:10-0500
TIME_BASIC
          Example: 20120701T142110-0500
TIME_EXTENDED
          Example: 2012-07-01T14:21:10-05:00
UTC_TIME_BASIC
          Example: 20120701T192110Z
UTC_TIME_EXTENDED
          Example: 2012-07-01T19:21:10Z
 
Method Summary
 DateFormat getFormatDateFormat()
          Builds a DateFormat object for formatting dates in this ISO format.
 DateFormat getParseDateFormat()
          Builds a DateFormat object for parsing dates in this ISO format.
 boolean matches(String dateStr)
          Determines whether a date string is in this ISO format.
static ISOFormat valueOf(String name)
          Returns the enum constant of this type with the specified name.
static ISOFormat[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

DATE_BASIC

public static final ISOFormat DATE_BASIC
Example: 20120701


DATE_EXTENDED

public static final ISOFormat DATE_EXTENDED
Example: 2012-07-01


TIME_BASIC

public static final ISOFormat TIME_BASIC
Example: 20120701T142110-0500


TIME_EXTENDED

public static final ISOFormat TIME_EXTENDED
Example: 2012-07-01T14:21:10-05:00


UTC_TIME_BASIC

public static final ISOFormat UTC_TIME_BASIC
Example: 20120701T192110Z


UTC_TIME_EXTENDED

public static final ISOFormat UTC_TIME_EXTENDED
Example: 2012-07-01T19:21:10Z


HCARD_TIME_TAG

public static final ISOFormat HCARD_TIME_TAG
Example: 2012-07-01T14:21:10-0500

Method Detail

values

public static ISOFormat[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (ISOFormat c : ISOFormat.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static ISOFormat valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

matches

public boolean matches(String dateStr)
Determines whether a date string is in this ISO format.

Parameters:
dateStr - the date string
Returns:
true if it matches the date format, false if not

getParseDateFormat

public DateFormat getParseDateFormat()
Builds a DateFormat object for parsing dates in this ISO format.

Returns:
the DateFormat object

getFormatDateFormat

public DateFormat getFormatDateFormat()
Builds a DateFormat object for formatting dates in this ISO format.

Returns:
the DateFormat object


Copyright © 2012-2014 Michael Angstadt. All Rights Reserved.