All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class multilizer.FileDictionary

java.lang.Object
   |
   +----multilizer.Dictionary
           |
           +----multilizer.BundleDictionary
                   |
                   +----multilizer.FileDictionary

public abstract class FileDictionary
extends BundleDictionary
A abstract dictionary component that gets translation data from Multilizer's bundle files

See Also:
BinaryDictionary, TextDictionary

Variable Index

 o extension
 o translations
An array that contains the native and current strings of the dictionary.
 o translationStreamListener

Constructor Index

 o FileDictionary(String)

Method Index

 o addTranslationStreamListener(TranslationStreamListener)
Adds the specified stream listener to receive translation stream aquire events from this dictionary.
 o disconnect()
 o getBundleFileName()
 o languageChanged(boolean, boolean)
Dictionary calls this method after the current language has been changed.
 o loadTranslation()
Loads the translation data from the file to the array.
 o removeTranslationStreamListener(TranslationStreamListener)
Removes the stream aquire listener so it no longer receives stream events from this dictionary.
 o sortTranslations(int, int)
Sorts the translation array.
 o translateString(String)
Returns the translation of the native string in the current language.

Variables

 o translationStreamListener
 protected TranslationStreamListener translationStreamListener
 o extension
 protected String extension
 o translations
 protected transient Vector translations
An array that contains the native and current strings of the dictionary. Each item contains a Translation object.

Constructors

 o FileDictionary
 public FileDictionary(String extension)

Methods

 o getBundleFileName
 protected String getBundleFileName()
 o disconnect
 protected void disconnect()
 o translateString
 protected String translateString(String str)
Returns the translation of the native string in the current language.

Overrides:
translateString in class Dictionary
 o loadTranslation
 protected abstract void loadTranslation() throws Exception
Loads the translation data from the file to the array.

 o languageChanged
 protected void languageChanged(boolean languageChanged,
                                boolean localeChanged) throws Exception
Dictionary calls this method after the current language has been changed.

Overrides:
languageChanged in class Dictionary
 o sortTranslations
 protected void sortTranslations(int left,
                                 int right)
Sorts the translation array.

Parameters:
left - the index of the first item to be sorted
right - the index of the last item to be sorted
 o addTranslationStreamListener
 public synchronized void addTranslationStreamListener(TranslationStreamListener l)
Adds the specified stream listener to receive translation stream aquire events from this dictionary. There can be only one listener at a time.

Parameters:
l - the text dictionary listener
 o removeTranslationStreamListener
 public synchronized void removeTranslationStreamListener(TranslationStreamListener l)
Removes the stream aquire listener so it no longer receives stream events from this dictionary.


All Packages  Class Hierarchy  This Package  Previous  Next  Index