Class IPADictionaryLibrary

java.lang.Object
ca.phon.ipadictionary.IPADictionaryLibrary
All Implemented Interfaces:
IExtendable

public class IPADictionaryLibrary extends Object implements IExtendable
Manages the library of available IPA dictionaries.
  • Field Details

    • DEFAULT_IPA_DICTIONARY_PROP

      public static final String DEFAULT_IPA_DICTIONARY_PROP
  • Method Details

    • getInstance

      public static IPADictionaryLibrary getInstance()
      Get the shared library instance.
      Returns:
      the shared static instance
    • availableDictionaries

      public Iterator<IPADictionary> availableDictionaries()
      Provides an iterator of all available dictionaries. Dictionaries are in on particular sort order.
      Returns:
      iterator of availble dictionaries
    • availableLanguages

      public Set<Language> availableLanguages()
      Get a list of all distinct LanguageInfos available.
      Returns:
      list of availble languages
    • getDefaultLanguage

      public Language getDefaultLanguage()
      Get default IPA dictionary language
      Returns:
      default language
    • defaultDictionary

      public IPADictionary defaultDictionary()
      Get default IPA dictionary, if no preference is set this will return the first dictionary found.
      Returns:
      default IPA dictionary
    • dictionariesForLanguage

      public List<IPADictionary> dictionariesForLanguage(String lang)
      Get all dictionaries for the specified primary language
      Parameters:
      lang -
      Returns:
      list of dictionaries for given lang
    • dictionariesForLanguage

      public List<IPADictionary> dictionariesForLanguage(Language lang)
      Get all dictionaries for the specified primary language
      Parameters:
      lang -
      Returns:
      list of dictionaries for given lang
    • getLoader

      public ResourceLoader<IPADictionary> getLoader()
      Get the loader used with the library.
      Returns:
      the resource loader
    • getExtensions

      public Set<Class<?>> getExtensions()
      Description copied from interface: IExtendable
      Return all extension types supported
      Specified by:
      getExtensions in interface IExtendable
    • getExtension

      public <T> T getExtension(Class<T> cap)
      Description copied from interface: IExtendable
      Get the requested extension if available.
      Specified by:
      getExtension in interface IExtendable
      Returns:
      the capability object or null if the cability is not available
    • putExtension

      public <T> T putExtension(Class<T> cap, T impl)
      Description copied from interface: IExtendable
      Add a new extension.
      Specified by:
      putExtension in interface IExtendable
      Parameters:
      cap - the extension to add
      Returns:
      the added extension implementation
    • removeExtension

      public <T> T removeExtension(Class<T> cap)
      Description copied from interface: IExtendable
      Remove a capability.
      Specified by:
      removeExtension in interface IExtendable
      Parameters:
      cap - the capability to remove