org.efaps.number2words.converters
Class German

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

public class German
extends AbstractDecimalConverter

The class implements the conversion of numbers to German words.

Version:
$Id: German.java 2698 2009-06-27 12:15:16Z tim.moxter $
Author:
The eFaps Team

Constructor Summary
German()
           
 
Method Summary
protected  java.lang.String convertLessThanOneHundred(int _number)
          Converts number less than one hundred into German words.
protected  java.lang.String convertPower(int _number, int _power)
          The method converts the given _number depending on the _power to words.
protected  java.lang.String getMinus()
          Returns the related German 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, 1 000, 1 000 000 and 1 000 000 000.
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').
 
Methods inherited from class org.efaps.number2words.converters.AbstractDecimalConverter
convert, convertLessThanOneThousand, isDecimal, usesShortScale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

German

public German()
Method Detail

convertLessThanOneHundred

protected java.lang.String convertLessThanOneHundred(int _number)

Converts number less than one hundred into German words. The original method was override because in German language the convert is done using first the last digit (one, two, ...) and then the 'ten' digit (twenty, thirty, ...) concatenated by an 'and'.

Examples:

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

convertPower

protected java.lang.String convertPower(int _number,
                                        int _power)
The method converts the given _number depending on the _power to words. The real number to convert is "_number * (10 ^ _power)". The original method is overwritten because if _number is equal one, the values from SINGLE_POWER_NAMES must be used.

Overrides:
convertPower in class AbstractDecimalConverter
Parameters:
_number - number to convert
_power - power of the number
Returns:
converted string
See Also:
SINGLE_POWER_NAMES

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, 1 000, 1 000 000 and 1 000 000 000.

Specified by:
getPowerNames in class AbstractDecimalConverter
Returns:
string array of log numbers
See Also:
AbstractDecimalConverter.getPowerNames(), #LOG_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 "null"

getMinus

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

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


Copyright © 2009 eFaps. All Rights Reserved.