Project Wonder 5.0

er.chronic
Class ChronicFormatter

java.lang.Object
  extended by java.text.Format
      extended by java.text.DateFormat
          extended by java.text.SimpleDateFormat
              extended by er.chronic.ChronicFormatter
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class ChronicFormatter
extends java.text.SimpleDateFormat

ChronicFormatter attempts to parse a date using an expected date format, and then falls back to using Chronic in the event of a parse failure.

See Also:
Serialized Form
Author:
probert

Nested Class Summary
 
Nested classes/interfaces inherited from class java.text.DateFormat
java.text.DateFormat.Field
 
Field Summary
 
Fields inherited from class java.text.DateFormat
AM_PM_FIELD, calendar, DATE_FIELD, DAY_OF_WEEK_FIELD, DAY_OF_WEEK_IN_MONTH_FIELD, DAY_OF_YEAR_FIELD, DEFAULT, ERA_FIELD, FULL, HOUR_OF_DAY0_FIELD, HOUR_OF_DAY1_FIELD, HOUR0_FIELD, HOUR1_FIELD, LONG, MEDIUM, MILLISECOND_FIELD, MINUTE_FIELD, MONTH_FIELD, numberFormat, SECOND_FIELD, SHORT, TIMEZONE_FIELD, WEEK_OF_MONTH_FIELD, WEEK_OF_YEAR_FIELD, YEAR_FIELD
 
Constructor Summary
ChronicFormatter(java.lang.String pattern)
          Constructs a new ChronicFormatter.
ChronicFormatter(java.lang.String pattern, Options options)
          Constructs a new ChronicFormatter.
ChronicFormatter(java.lang.String pattern, Options options, boolean guessingEarly)
          Constructs a new ChronicFormatter.
 
Method Summary
 boolean isGuessingEarly()
          Returns whether or not this parser guesses the beginning of a span if a date parses as a span.
 Options options()
          Returns the options used by this formatter.
 com.webobjects.foundation.NSTimestamp parseObject(java.lang.String text)
           
 void setGuessingEarly(boolean guessingEarly)
          Sets whether or not this parser guesses the beginning of a span if a date parses as a span.
 void setOptions(Options options)
          Sets the options used by this formatter.
 
Methods inherited from class java.text.SimpleDateFormat
applyLocalizedPattern, applyPattern, clone, equals, format, formatToCharacterIterator, get2DigitYearStart, getDateFormatSymbols, hashCode, parse, set2DigitYearStart, setDateFormatSymbols, toLocalizedPattern, toPattern
 
Methods inherited from class java.text.DateFormat
format, format, getAvailableLocales, getCalendar, getDateInstance, getDateInstance, getDateInstance, getDateTimeInstance, getDateTimeInstance, getDateTimeInstance, getInstance, getNumberFormat, getTimeInstance, getTimeInstance, getTimeInstance, getTimeZone, isLenient, parse, parseObject, setCalendar, setLenient, setNumberFormat, setTimeZone
 
Methods inherited from class java.text.Format
format
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChronicFormatter

public ChronicFormatter(java.lang.String pattern)
Constructs a new ChronicFormatter.

Parameters:
pattern - the SimpleDateFormat pattern to parse
options - the chronic options to parse with

ChronicFormatter

public ChronicFormatter(java.lang.String pattern,
                        Options options)
Constructs a new ChronicFormatter.

Parameters:
pattern - the SimpleDateFormat pattern to parse
options - the chronic options to parse with

ChronicFormatter

public ChronicFormatter(java.lang.String pattern,
                        Options options,
                        boolean guessingEarly)
Constructs a new ChronicFormatter.

Parameters:
pattern - the SimpleDateFormat pattern to parse
options - the chronic options to parse with
guessingEarly - if true, guess the start of a span if the parsed date returns a span
Method Detail

options

public Options options()
Returns the options used by this formatter.

Returns:
the options used by this formatter

setOptions

public void setOptions(Options options)
Sets the options used by this formatter.

Parameters:
options - the options used by this formatter

isGuessingEarly

public boolean isGuessingEarly()
Returns whether or not this parser guesses the beginning of a span if a date parses as a span.

Returns:
whether or not this parser guesses the beginning of a span

setGuessingEarly

public void setGuessingEarly(boolean guessingEarly)
Sets whether or not this parser guesses the beginning of a span if a date parses as a span.

Parameters:
guessingEarly - whether or not this parser guesses the beginning of a span

parseObject

public com.webobjects.foundation.NSTimestamp parseObject(java.lang.String text)
                                                  throws java.text.ParseException
Overrides:
parseObject in class java.text.Format
Throws:
java.text.ParseException

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.