net.sourceforge.rssowl.util.i18n
Class Translation

java.lang.Object
  extended bynet.sourceforge.rssowl.util.i18n.Translation
Direct Known Subclasses:
RSSOwlI18nBG, RSSOwlI18nBN, RSSOwlI18nCS, RSSOwlI18nDA, RSSOwlI18nDE, RSSOwlI18nEL, RSSOwlI18nEN, RSSOwlI18nES, RSSOwlI18nFI, RSSOwlI18nFR, RSSOwlI18nGL, RSSOwlI18nHU, RSSOwlI18nIT, RSSOwlI18nJA, RSSOwlI18nKO, RSSOwlI18nNL, RSSOwlI18nNO, RSSOwlI18nPL, RSSOwlI18nPT, RSSOwlI18nRU, RSSOwlI18nSL, RSSOwlI18nSV, RSSOwlI18nTH, RSSOwlI18nTR, RSSOwlI18nUK, RSSOwlI18nZHcn, RSSOwlI18nZHtw

public abstract class Translation
extends Object

Translation is the Super-Class for all i18n translation classes in RSSOwl. It provides the HashMap, to store the translations. A locale indicates for what locales the translation should be used.

Version:
1.1.3
Author:
Benjamin Pasero

Field Summary
private static int HASHMAP_INITIAL_CAP
          The initial capacity of the Dictionaries HashMap.
private  Locale locale
          Locale of the translation
protected  HashMap translation
          The HashMap maps i18n-keys to translated values.
 
Constructor Summary
protected Translation(String language, String country)
          Instantiate a new translation for a locale
 
Method Summary
 HashMap getTranslation()
          Get the Hashmap with the translation
protected abstract  void initTranslation()
          Fill the HashMap with translations
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HASHMAP_INITIAL_CAP

private static final int HASHMAP_INITIAL_CAP
The initial capacity of the Dictionaries HashMap. Since the number of words is known, it is possible to calculate the optimal capacity.

In order to avoid calls to rehash() while adding Elements, the initial capacity must be set to a value bigger than Entries divided by Load Factor.

Current Wording Count: 431
Default Load Factor: 0.75
Optimal Initial Cap: 431/0.75 = 575 (approx.)

See Also:
Constant Field Values

locale

private Locale locale
Locale of the translation


translation

protected HashMap translation
The HashMap maps i18n-keys to translated values.

Constructor Detail

Translation

protected Translation(String language,
                      String country)
Instantiate a new translation for a locale

Parameters:
language - two-letter ISO-639 code
country - two-letter ISO-3166 code
Method Detail

getTranslation

public HashMap getTranslation()
Get the Hashmap with the translation

Returns:
Returns the translation.

toString

public String toString()
See Also:
Object.toString()

initTranslation

protected abstract void initTranslation()
Fill the HashMap with translations



RSSOwl - RSS / RDF / Atom Newsreader

SourceForge.net Logo