|
Joda Time API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
Combined interface for printing and parsing.
| Method Summary | |
int |
estimateParsedLength()
Returns the expected maximum number of characters consumed. |
int |
estimatePrintedLength()
Returns the expected maximum number of characters produced. |
Chronology |
getChronology()
Returns the Chronology being used by the formatter, or null if none. |
DateTime |
parseDateTime(java.lang.String text)
Parses a datetime from the given text, returning a new DateTime. |
int |
parseInto(DateTimeParserBucket bucket,
java.lang.String text,
int position)
Parse an element from the given text, saving any fields into the given DateTimeParserBucket. |
int |
parseInto(ReadWritableInstant instant,
java.lang.String text,
int position)
Parses a datetime from the given text, at the given position, saving the result into the fields of the given ReadWritableInstant. |
long |
parseMillis(java.lang.String text)
Parses a datetime from the given text, returning the number of milliseconds since the epoch, 1970-01-01T00:00:00Z. |
long |
parseMillis(java.lang.String text,
long millis)
Parses a datetime from the given text, at the given position, returning the number of milliseconds since the epoch, 1970-01-01T00:00:00Z. |
MutableDateTime |
parseMutableDateTime(java.lang.String text)
Parses a datetime from the given text, returning a new MutableDateTime. |
java.lang.String |
print(long millisUTC)
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, using the formatter's DateTimeZone. |
java.lang.String |
print(long millisUTC,
DateTimeZone zone)
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, attempting to use the given DateTimeZone. |
java.lang.String |
print(long millisUTC,
DateTimeZone zone,
long millisLocal)
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, attempting to use the given DateTimeZone. |
java.lang.String |
print(ReadableInstant instant)
Prints a ReadableInstant to a new String, attempting to use the DateTimeZone supplied by the instant. |
void |
printTo(java.lang.StringBuffer buf,
long millisUTC)
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, using the formatter's DateTimeZone. |
void |
printTo(java.lang.StringBuffer buf,
long millisUTC,
DateTimeZone zone)
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, attempting to use the given DateTimeZone. |
void |
printTo(java.lang.StringBuffer buf,
long millisUTC,
DateTimeZone zone,
long millisLocal)
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, attempting to use the given DateTimeZone. |
void |
printTo(java.lang.StringBuffer buf,
ReadableInstant instant)
Prints a ReadableInstant, attempting to use the DateTimeZone supplied by the instant. |
void |
printTo(java.io.Writer out,
long millisUTC)
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, using the formatter's DateTimeZone. |
void |
printTo(java.io.Writer out,
long millisUTC,
DateTimeZone zone)
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, attempting to use the given DateTimeZone. |
void |
printTo(java.io.Writer out,
long millisUTC,
DateTimeZone zone,
long millisLocal)
Prints an instant from milliseconds since 1970-01-01T00:00:00Z, attempting to use the given DateTimeZone. |
void |
printTo(java.io.Writer out,
ReadableInstant instant)
Prints a ReadableInstant, attempting to use the DateTimeZone supplied by the instant. |
| Method Detail |
public Chronology getChronology()
getChronology in interface DateTimePrinterpublic int estimatePrintedLength()
estimatePrintedLength in interface DateTimePrinter
public void printTo(java.lang.StringBuffer buf,
ReadableInstant instant)
printTo in interface DateTimePrinterbuf - formatted instant is appended to this bufferinstant - instant to format
public void printTo(java.io.Writer out,
ReadableInstant instant)
throws java.io.IOException
printTo in interface DateTimePrinterout - formatted instant is written outinstant - instant to format
java.io.IOException
public void printTo(java.lang.StringBuffer buf,
long millisUTC)
printTo in interface DateTimePrinterbuf - formatted instant is appended to this buffermillisUTC - millis since 1970-01-01T00:00:00Z
public void printTo(java.io.Writer out,
long millisUTC)
throws java.io.IOException
printTo in interface DateTimePrinterout - formatted instant is written outmillisUTC - millis since 1970-01-01T00:00:00Z
java.io.IOException
public void printTo(java.lang.StringBuffer buf,
long millisUTC,
DateTimeZone zone)
printTo in interface DateTimePrinterbuf - formatted instant is appended to this buffermillisUTC - millis since 1970-01-01T00:00:00Zzone - DateTimeZone to use, overriding the formatter's own zone if
not null
public void printTo(java.io.Writer out,
long millisUTC,
DateTimeZone zone)
throws java.io.IOException
printTo in interface DateTimePrinterout - formatted instant is written outmillisUTC - millis since 1970-01-01T00:00:00Zzone - DateTimeZone to use, overriding the formatter's own zone if
not null
java.io.IOException
public void printTo(java.lang.StringBuffer buf,
long millisUTC,
DateTimeZone zone,
long millisLocal)
printTo in interface DateTimePrinterbuf - formatted instant is appended to this buffermillisUTC - millis since 1970-01-01T00:00:00Z, used by time zone
printerszone - DateTimeZone to use, overriding the formatter's own zone if
not nullmillisLocal - pre-calculated millis since 1970-01-01T00:00:00,
local time
public void printTo(java.io.Writer out,
long millisUTC,
DateTimeZone zone,
long millisLocal)
throws java.io.IOException
printTo in interface DateTimePrinterout - formatted instant is written outmillisUTC - millis since 1970-01-01T00:00:00Z, used by time zone
printerszone - DateTimeZone to use, overriding the formatter's own zone if
not nullmillisLocal - pre-calculated millis since 1970-01-01T00:00:00,
local time
java.io.IOExceptionpublic java.lang.String print(ReadableInstant instant)
print in interface DateTimePrinterinstant - instant to format
public java.lang.String print(long millisUTC)
print in interface DateTimePrintermillisUTC - millis since 1970-01-01T00:00:00Z
public java.lang.String print(long millisUTC,
DateTimeZone zone)
print in interface DateTimePrintermillisUTC - millis since 1970-01-01T00:00:00Zzone - DateTimeZone to use, overriding the formatter's own zone if
not null
public java.lang.String print(long millisUTC,
DateTimeZone zone,
long millisLocal)
print in interface DateTimePrintermillisUTC - millis since 1970-01-01T00:00:00Zzone - DateTimeZone to use, overriding the formatter's own zone if
not nullmillisLocal - pre-calculated millis since 1970-01-01T00:00:00,
local time
public int estimateParsedLength()
estimateParsedLength in interface DateTimeParser
public int parseInto(DateTimeParserBucket bucket,
java.lang.String text,
int position)
If it fails, the return value is negative. To determine the position where the parse failed, apply the one's complement operator (~) on the return value.
parseInto in interface DateTimeParserbucket - field are saved into thistext - the text to parseposition - position to start parsing from
java.lang.IllegalArgumentException - if any field is out of range
public int parseInto(ReadWritableInstant instant,
java.lang.String text,
int position)
If it fails, the return value is negative, but the instant may still be modified. To determine the position where the parse failed, apply the one's complement operator (~) on the return value.
parseInto in interface DateTimeParserinstant - an instant that will be modifiedtext - text to parseposition - position to start parsing from
java.lang.IllegalArgumentException - if any field is out of range
public long parseMillis(java.lang.String text)
throws java.text.ParseException
parseMillis in interface DateTimeParsertext - text to parse
java.text.ParseException - if any field is out of range
public long parseMillis(java.lang.String text,
long millis)
throws java.text.ParseException
parseMillis in interface DateTimeParsertext - text to parsemillis - initial value of millis, relative to the epoch, local time
java.text.ParseException - if any field is out of range
public DateTime parseDateTime(java.lang.String text)
throws java.text.ParseException
parseDateTime in interface DateTimeParsertext - text to parse
java.text.ParseException - if any field is out of range
public MutableDateTime parseMutableDateTime(java.lang.String text)
throws java.text.ParseException
parseMutableDateTime in interface DateTimeParsertext - text to parse
java.text.ParseException - if any field is out of range
|
Joda Time API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||