|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.efaps.number2words.converters.AbstractDecimalConverter
public abstract class AbstractDecimalConverter
Abstract helper class which implements the main methods for the conversion of numbers to words for languages which uses the decimal system.
| Constructor Summary | |
|---|---|
AbstractDecimalConverter()
|
|
| Method Summary | |
|---|---|
java.lang.String |
convert(long _number)
Method to convert a number into words. |
protected abstract java.lang.String |
convertLessThanOneHundred(int _number)
The method converts the numbers from 1 to 99 into words. |
protected java.lang.String |
convertLessThanOneThousand(int _number)
Method to convert the numbers from 1 to 999. |
protected java.lang.String |
convertPower(int _number,
int _power)
The method converts the given _number depending on the
_power to words. |
protected abstract java.lang.String |
getMinus()
Returns the language specific word for "minus". |
protected abstract java.lang.String[] |
getNumNames()
Returns the string array to define the conversion of numbers for 1 till 19. |
protected abstract java.lang.String[] |
getPowerNames()
Returns the string array for power numbers 1000^n. |
protected abstract java.lang.String[] |
getTensNames()
Returns the string array for a zero length string and the words for numbers 10, 20, 30, 40, 50, 60, 70, 80, 90 and 100. |
protected abstract java.lang.String |
getZero()
Returns the language specific word for the number 0. |
boolean |
isDecimal()
The abstract class helps to implement converters for languages which are using the decimal system. |
boolean |
usesShortScale()
A false is returned because typically a language should use the long scale numerical system. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AbstractDecimalConverter()
| Method Detail |
|---|
protected java.lang.String convertLessThanOneThousand(int _number)
_number modular 100) are converted to words with
convertLessThanOneHundred(int) so that some special kinds for
languages could be easy implemented.
_number - number less than one thousand to be converted
convertLessThanOneHundred(int)protected abstract java.lang.String convertLessThanOneHundred(int _number)
convertLessThanOneThousand(int).
_number - number less than one hundred to convert
_number in wordsprotected abstract java.lang.String[] getNumNames()
protected abstract java.lang.String[] getTensNames()
protected abstract java.lang.String[] getPowerNames()
1000^n. The
translated word values must be defined in this order:
n = 0: thousandn = 1: millionn = 2: billionn = 3: trillionn = 4: quadrillionn = 5: quintillion
protected abstract java.lang.String getZero()
protected abstract java.lang.String getMinus()
protected java.lang.String convertPower(int _number,
int _power)
_number depending on the
_power to words. The real number to convert is
"_number * (10 ^ _power)".
_number - number to convert_power - power of the number
public java.lang.String convert(long _number)
convert in interface IConverter_number - number to convert
IConverter.convert(long),
FORMAT_MASKpublic boolean isDecimal()
isDecimal in interface IConverterpublic boolean usesShortScale()
usesShortScale in interface IConverterIConverter.isDecimal()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||