Joda Time API

org.joda.time.format
Class AbstractDateTimeFormatter

java.lang.Object
  |
  +--org.joda.time.format.AbstractDateTimeFormatter

public abstract class AbstractDateTimeFormatter
extends java.lang.Object

Abstract base class for implementing DateTimePrinters, DateTimeParsers, and DateTimeFormatters. This class intentionally does not implement any of those interfaces. You can subclass and implement only the interfaces that you need to.

The print methods assume that your subclass has implemented DateTimePrinter or DateTimeFormatter. If not, a ClassCastException is thrown when calling those methods.

Likewise, the parse methods assume that your subclass has implemented DateTimeParser or DateTimeFormatter. If not, a ClassCastException is thrown when calling the parse methods.

Author:
Brian S O'Neill

Constructor Summary
AbstractDateTimeFormatter()
           
 
Method Summary
abstract  Chronology getChronology()
          Returns the Chronology being used by the formatter, or null if none.
 DateTime parseDateTime(java.lang.String text)
           
 int parseInto(ReadWritableInstant instant, java.lang.String text, int position)
           
 long parseMillis(java.lang.String text)
           
 long parseMillis(java.lang.String text, long millis)
           
 MutableDateTime parseMutableDateTime(java.lang.String text)
           
 java.lang.String print(long millisUTC)
           
 java.lang.String print(long millisUTC, DateTimeZone zone)
           
 java.lang.String print(long millisUTC, DateTimeZone zone, long millisLocal)
           
 java.lang.String print(ReadableInstant instant)
           
 void printTo(java.lang.StringBuffer buf, long millisUTC)
           
 void printTo(java.lang.StringBuffer buf, long millisUTC, DateTimeZone zone)
           
 void printTo(java.lang.StringBuffer buf, ReadableInstant instant)
           
 void printTo(java.io.Writer out, long millisUTC)
           
 void printTo(java.io.Writer out, long millisUTC, DateTimeZone zone)
           
 void printTo(java.io.Writer out, ReadableInstant instant)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDateTimeFormatter

public AbstractDateTimeFormatter()
Method Detail

getChronology

public abstract Chronology getChronology()
Returns the Chronology being used by the formatter, or null if none.


printTo

public void printTo(java.lang.StringBuffer buf,
                    ReadableInstant instant)

printTo

public void printTo(java.io.Writer out,
                    ReadableInstant instant)
             throws java.io.IOException
java.io.IOException

printTo

public void printTo(java.lang.StringBuffer buf,
                    long millisUTC)

printTo

public void printTo(java.io.Writer out,
                    long millisUTC)
             throws java.io.IOException
java.io.IOException

printTo

public void printTo(java.lang.StringBuffer buf,
                    long millisUTC,
                    DateTimeZone zone)

printTo

public void printTo(java.io.Writer out,
                    long millisUTC,
                    DateTimeZone zone)
             throws java.io.IOException
java.io.IOException

print

public java.lang.String print(ReadableInstant instant)

print

public java.lang.String print(long millisUTC)

print

public java.lang.String print(long millisUTC,
                              DateTimeZone zone)

print

public java.lang.String print(long millisUTC,
                              DateTimeZone zone,
                              long millisLocal)

parseInto

public int parseInto(ReadWritableInstant instant,
                     java.lang.String text,
                     int position)

parseMillis

public long parseMillis(java.lang.String text)
                 throws java.text.ParseException
java.text.ParseException

parseMillis

public long parseMillis(java.lang.String text,
                        long millis)
                 throws java.text.ParseException
java.text.ParseException

parseDateTime

public DateTime parseDateTime(java.lang.String text)
                       throws java.text.ParseException
java.text.ParseException

parseMutableDateTime

public MutableDateTime parseMutableDateTime(java.lang.String text)
                                     throws java.text.ParseException
java.text.ParseException

Joda Time API

Copyright © 2001-2003 Stephen Colebourne. All Rights Reserved.