org.efaps.number2words.converters
Class English

java.lang.Object
  extended by org.efaps.number2words.converters.AbstractDecimalConverter
      extended by org.efaps.number2words.converters.English
All Implemented Interfaces:
IConverter

public class English
extends AbstractDecimalConverter

The class implements the conversion of numbers to English words.

Version:
$Id: English.java 2699 2009-06-27 12:58:51Z tim.moxter $
Author:
The eFaps Team

Constructor Summary
English()
           
 
Method Summary
protected  java.lang.String convertLessThanOneHundred(int _number)
          The method converts the numbers from 1 to 99 into words.
protected  java.lang.String getMinus()
          Returns the related English word for "minus" needed for negative numbers.
protected  java.lang.String[] getNumNames()
          Returns the string array to define the conversion of numbers for 1 till 19.
protected  java.lang.String[] getPowerNames()
          Returns the string array for log numbers 100, 1000, 1000000 and 1000000000.
protected  java.lang.String[] getTensNames()
          Returns the string array for the numbers 10, 20, 30, 40, 50, 60, 70, 80 and 90.
protected  java.lang.String getZero()
          Returns the related English word for the number zero ('0').
 boolean usesShortScale()
          Returns always true because the English language uses for the representation of numbers in words the short scale system.
 
Methods inherited from class org.efaps.number2words.converters.AbstractDecimalConverter
convert, convertLessThanOneThousand, convertPower, isDecimal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

English

public English()
Method Detail

convertLessThanOneHundred

protected java.lang.String convertLessThanOneHundred(int _number)
The method converts the numbers from 1 to 99 into words. The method is used from AbstractDecimalConverter.convertLessThanOneThousand(int).

Specified by:
convertLessThanOneHundred in class AbstractDecimalConverter
Parameters:
_number - number less than one hundred to convert
Returns:
converted _number in words

getNumNames

protected java.lang.String[] getNumNames()
Returns the string array to define the conversion of numbers for 1 till 19.

Specified by:
getNumNames in class AbstractDecimalConverter
Returns:
string array of numbers
See Also:
AbstractDecimalConverter.getNumNames(), NUM_NAMES

getTensNames

protected java.lang.String[] getTensNames()
Returns the string array for the numbers 10, 20, 30, 40, 50, 60, 70, 80 and 90.

Specified by:
getTensNames in class AbstractDecimalConverter
Returns:
string array of tens names
See Also:
AbstractDecimalConverter.getTensNames(), TENS_NAMES

getPowerNames

protected java.lang.String[] getPowerNames()
Returns the string array for log numbers 100, 1000, 1000000 and 1000000000.

Specified by:
getPowerNames in class AbstractDecimalConverter
Returns:
string array of log numbers
See Also:
AbstractDecimalConverter.getPowerNames(), POWER_NAMES

getZero

protected java.lang.String getZero()
Returns the related English word for the number zero ('0').

Specified by:
getZero in class AbstractDecimalConverter
Returns:
always the text string "zero"

getMinus

protected java.lang.String getMinus()
Returns the related English word for "minus" needed for negative numbers.

Specified by:
getMinus in class AbstractDecimalConverter
Returns:
always the English text string "minus"

usesShortScale

public boolean usesShortScale()
Returns always true because the English language uses for the representation of numbers in words the short scale system. Only the "traditional British English" language uses sometimes the long scale system (but not supported from this English converter).

Specified by:
usesShortScale in interface IConverter
Overrides:
usesShortScale in class AbstractDecimalConverter
Returns:
always true
See Also:
IConverter.isDecimal()


Copyright © 2009 eFaps. All Rights Reserved.