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
An abstract dictionary component that gets translation data from file(s).

See Also:
BinaryDictionary, TextDictionary

Variable Index

 o FILE_USAGE_AUTO
 o FILE_USAGE_BUNDLE
 o FILE_USAGE_SINGLE
 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 contextSortTranslations(int, int)
Sorts the translation array using contexts.
 o disconnect()
 o getActiveBundleName()
 o getActiveBundleName(String)
 o getActiveFileName()
 o getActiveFileName(String)
 o getFileUsage()
 o getTranslationCount()
Returns the translation count.
 o getUseBundle()
Returns true of the dictionary use a bundle of files instead of a single file.
 o languageChanged(boolean, boolean)
Dictionary calls this method after the current language has been changed.
 o loadLocalTranslation(Container, Vector)
 o loadTranslation(Vector, String)
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 setFileUsage(int)
 o sort(Vector)
Sorts the translation array.
 o sortTranslations(int, int)
Sorts the translation array.
 o translateString(String)
Returns the translation of the native string in the current language.
 o translateString(String, String, String)
Returns the translation of the context sensitive native string in the current language.

Variables

 o FILE_USAGE_AUTO
 public static final int FILE_USAGE_AUTO
 o FILE_USAGE_SINGLE
 public static final int FILE_USAGE_SINGLE
 o FILE_USAGE_BUNDLE
 public static final int FILE_USAGE_BUNDLE
 o translationStreamListener
 protected TranslationStreamListener translationStreamListener

Constructors

 o FileDictionary
 public FileDictionary(String extension)

Methods

 o getTranslationCount
 public int getTranslationCount()
Returns the translation count.

Overrides:
getTranslationCount in class Dictionary
 o getFileUsage
 public int getFileUsage()
 o setFileUsage
 public void setFileUsage(int value)
 o getUseBundle
 protected boolean getUseBundle()
Returns true of the dictionary use a bundle of files instead of a single file.

 o getActiveBundleName
 protected String getActiveBundleName(String fileName)
 o getActiveBundleName
 protected String getActiveBundleName()
 o getActiveFileName
 protected String getActiveFileName(String fileName)
 o getActiveFileName
 protected String getActiveFileName()
 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 translateString
 protected String translateString(String str,
                                  String form,
                                  String component)
Returns the translation of the context sensitive native string in the current language.

Overrides:
translateString in class Dictionary
 o loadLocalTranslation
 public void loadLocalTranslation(Container host,
                                  Vector translations)
 o loadTranslation
 protected abstract void loadTranslation(Vector translations,
                                         String fileName)
Loads the translation data from the file to the array.

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

Overrides:
languageChanged in class Dictionary
 o sort
 protected void sort(Vector translations)
Sorts the translation array.

 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 contextSortTranslations
 protected void contextSortTranslations(int left,
                                        int right)
Sorts the translation array using contexts.

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