|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.basex.query.util.format.Formatter
public abstract class Formatter
Abstract class for formatting data in different languages.
Nested Class Summary | |
---|---|
protected static class |
FormatUtil.Case
Cases. |
Constructor Summary | |
---|---|
Formatter()
|
Method Summary | |
---|---|
protected abstract byte[] |
ampm(boolean am)
Returns the am/pm marker. |
protected abstract byte[] |
calendar()
Returns the calendar. |
protected abstract byte[] |
day(int n,
int min,
int max)
Returns the specified day of the week (0-6, Sunday-Saturday). |
protected abstract byte[] |
era(long year)
Returns the era. |
byte[] |
formatDate(ADate date,
byte[] lng,
byte[] pic,
byte[] cal,
byte[] plc,
InputInfo ii)
Formats the specified date. |
byte[] |
formatInt(long num,
FormatParser fp)
Returns a formatted integer. |
byte[] |
formatZone(int num,
FormatParser fp,
byte[] marker)
Returns a formatted timezone. |
static Formatter |
get(byte[] ln)
Returns a formatter for the specified language. |
protected abstract byte[] |
month(int n,
int min,
int max)
Returns the specified month (0-11). |
protected abstract byte[] |
ordinal(long n,
byte[] ord)
Returns an ordinal representation for the specified number. |
protected abstract byte[] |
word(long n,
byte[] ord)
Returns a word representation for the specified number. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Formatter()
Method Detail |
---|
public static Formatter get(byte[] ln)
ln
- language
protected abstract byte[] word(long n, byte[] ord)
n
- number to be formattedord
- ordinal suffix
protected abstract byte[] ordinal(long n, byte[] ord)
n
- number to be formattedord
- ordinal suffix
protected abstract byte[] month(int n, int min, int max)
n
- number to be formattedmin
- minimum lengthmax
- maximum length
protected abstract byte[] day(int n, int min, int max)
n
- number to be formattedmin
- minimum lengthmax
- maximum length
protected abstract byte[] ampm(boolean am)
am
- am flag
protected abstract byte[] calendar()
protected abstract byte[] era(long year)
year
- year
public final byte[] formatDate(ADate date, byte[] lng, byte[] pic, byte[] cal, byte[] plc, InputInfo ii) throws QueryException
date
- date to be formattedlng
- languagepic
- picturecal
- calendarplc
- placeii
- input info
QueryException
- query exceptionpublic final byte[] formatInt(long num, FormatParser fp)
num
- integer to be formattedfp
- format parser
public final byte[] formatZone(int num, FormatParser fp, byte[] marker) throws QueryException
num
- integer to be formattedfp
- format parsermarker
- marker
QueryException
- query exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |