ch.claudio.contactdb.data
Class FuzzyDate

java.lang.Object
  extended by ch.claudio.contactdb.data.FuzzyDate

public class FuzzyDate
extends java.lang.Object

Version:
$Id: FuzzyDate.java 181 2007-04-18 14:53:43Z claudio $
Author:
Claudio Nieder

Nested Class Summary
static class FuzzyDate.Precision
          The possible interval precisions that can be handled.
 
Constructor Summary
FuzzyDate(java.lang.String date, FuzzyDate.Precision precision)
          Create a fuzzy day with the given date and precision.
 
Method Summary
static FuzzyDate create(java.lang.String year, java.lang.String month, java.lang.String day)
          Create a fuzzy date for a day.
 long getEnd()
           
 long getStart()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FuzzyDate

public FuzzyDate(java.lang.String date,
                 FuzzyDate.Precision precision)
Create a fuzzy day with the given date and precision. The date string has to be in ISO8601 format. It should match the precision given, e.g. with precision day supply a date like 2005-04-03 and not 2005-04-03T12:34.

Parameters:
date - String in ISO8601 format
precision - one of the supported enum values
Method Detail

getStart

public long getStart()
Returns:
the start of the interval in Java milliseconds.

getEnd

public long getEnd()
Returns:
the end of the interval in Java milliseconds.

create

public static FuzzyDate create(java.lang.String year,
                               java.lang.String month,
                               java.lang.String day)
Create a fuzzy date for a day.

Parameters:
year -
month -
day -
Returns:
fuzzy date for this day.