|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.number.AbstractNumberer
public abstract class AbstractNumberer
Class AbstractNumberer is a base implementation of Numberer that provides language-independent default numbering This supports the xsl:number element. Methods and data are declared as protected, and static is avoided, to allow easy subclassing.
Field Summary | |
---|---|
static int |
LOWER_CASE
|
static int |
TITLE_CASE
|
static int |
UPPER_CASE
|
Constructor Summary | |
---|---|
AbstractNumberer()
|
Method Summary | |
---|---|
abstract String |
dayName(int day,
int minWidth,
int maxWidth)
Get a day name or abbreviation |
String |
format(long number,
String picture,
int groupSize,
String groupSeparator,
String letterValue,
String ordinal)
Format a number into a string |
String |
getCalendarName(String code)
Get the name of a calendar |
String |
getCountry()
Get the country used by this numberer |
String |
getEraName(int year)
Get the name for an era (e.g. |
String |
getOrdinalSuffixForDateTime(String component)
Get an ordinal suffix for a particular component of a date/time. |
String |
halfDayName(int minutes,
int minWidth,
int maxWidth)
Get an am/pm indicator. |
abstract String |
monthName(int month,
int minWidth,
int maxWidth)
Get a month name or abbreviation |
void |
setCountry(String country)
Set the country used by this numberer (currenly used only for names of timezones) |
abstract String |
toOrdinalWords(String ordinalParam,
long number,
int wordCase)
Show an ordinal number as English words in a requested case (for example, Twentyfirst) |
static String |
toRoman(long n)
Generate a Roman numeral (in lower case) |
abstract String |
toWords(long number)
Show the number as words in title case. |
String |
toWords(long number,
int wordCase)
Format a number as English words with specified case options |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int UPPER_CASE
public static final int LOWER_CASE
public static final int TITLE_CASE
Constructor Detail |
---|
public AbstractNumberer()
Method Detail |
---|
public void setCountry(String country)
setCountry
in interface Numberer
public String getCountry()
getCountry
in interface Numberer
public String format(long number, String picture, int groupSize, String groupSeparator, String letterValue, String ordinal)
format
in interface Numberer
number
- The number to be formattedpicture
- The format token. This is a single component of the format attribute
of xsl:number, e.g. "1", "01", "i", or "a"groupSize
- number of digits per group (0 implies no grouping)groupSeparator
- string to appear between groups of digitsletterValue
- The letter-value specified to xsl:number: "alphabetic" or
"traditional". Can also be an empty string or null.ordinal
- The value of the ordinal attribute specified to xsl:number
The value "yes" indicates that ordinal numbers should be used; "" or null indicates
that cardinal numbers
public static String toRoman(long n)
n
- the number to be formatted
public abstract String toWords(long number)
number
- the number to be formatted
public String toWords(long number, int wordCase)
number
- the number to be formattedwordCase
- the required case for example UPPER_CASE
,
LOWER_CASE
, TITLE_CASE
public abstract String toOrdinalWords(String ordinalParam, long number, int wordCase)
ordinalParam
- the value of the "ordinal" attribute as supplied by the usernumber
- the number to be formattedwordCase
- the required case for example UPPER_CASE
,
LOWER_CASE
, TITLE_CASE
public abstract String monthName(int month, int minWidth, int maxWidth)
monthName
in interface Numberer
month
- The month number (1=January, 12=December)minWidth
- The minimum number of charactersmaxWidth
- The maximum number of characterspublic abstract String dayName(int day, int minWidth, int maxWidth)
dayName
in interface Numberer
day
- The day of the week (1=Monday, 7=Sunday)minWidth
- The minimum number of charactersmaxWidth
- The maximum number of characterspublic String halfDayName(int minutes, int minWidth, int maxWidth)
halfDayName
in interface Numberer
minutes
- the minutes within the dayminWidth
- minimum width of outputmaxWidth
- maximum width of output
public String getOrdinalSuffixForDateTime(String component)
getOrdinalSuffixForDateTime
in interface Numberer
component
- the component specifier from a format-dateTime picture, for
example "M" for the month or "D" for the day.
public String getEraName(int year)
getEraName
in interface Numberer
year
- the proleptic gregorian year, using "0" for the year before 1ADpublic String getCalendarName(String code)
getCalendarName
in interface Numberer
code
- The code representing the calendar as in the XSLT 2.0 spec, e.g. AD for the Gregorian calendar
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |