All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class multilizer.ServerDictionary

java.lang.Object
   |
   +----multilizer.Dictionary
           |
           +----multilizer.RemoteDictionary
                   |
                   +----multilizer.ServerDictionary

public class ServerDictionary
extends RemoteDictionary
A dictionary component that gets language and translation data from Dictionary Server.

Set the URL property to contain the host name (or IP address). Set the User and the Password properties specify the user account of the MDS. Set the DictionaryName property to contain the name of the dictionary. Call the open method to open the dictionary.


An example:
 ServerDictionary dictionary = new ServerDictionary();
dictionary.setURL("www.innoview.fi"); dictionary.setDictionaryName("javadcalc"); dictionary.setUser("guest"); dictionary.setPassword("guest"); try { dictionary.open(); } catch (Exception e) { }

See Also:
DatabaseDictionary

Constructor Index

 o ServerDictionary()

Method Index

 o close()
Closes the dictionary.
 o getDictionaryName()
Gets the name of the dictionary.
 o getLanguageCount()
Gets the amount of the languages in the dictionary.
 o getLanguageData(int)
Gets the specified language.
 o getPort()
Gets the port of the MDS.
 o languageChanged(boolean, boolean)
Dictionary calls this method after the current language has been changed.
 o open()
Opens the dictionary.
 o read()
Returns the reply message from the server.
 o send(String)
Sends the message to the server.
 o setDictionaryName(String)
Sets the name of the dictionary.
 o setPort(int)
Sets the port of the MDS.
 o transaction(String)
Makes a transaction to the server.
 o translateString(String)
Returns the translation of the native string in the current language.

Constructors

 o ServerDictionary
 public ServerDictionary()

Methods

 o getLanguageCount
 public int getLanguageCount() throws IOException
Gets the amount of the languages in the dictionary.

Overrides:
getLanguageCount in class Dictionary
 o getLanguageData
 public Language getLanguageData(int index) throws IOException
Gets the specified language.

Overrides:
getLanguageData in class Dictionary
 o translateString
 protected String translateString(String str)
Returns the translation of the native string in the current language.

Overrides:
translateString in class Dictionary
 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 open
 public void open() throws Exception
Opens the dictionary.

Overrides:
open in class Dictionary
 o close
 public void close()
Closes the dictionary.

Overrides:
close in class Dictionary
 o send
 protected void send(String msg) throws IOException
Sends the message to the server.

Parameters:
msg - the message to be sent
 o read
 protected String read() throws IOException
Returns the reply message from the server.

 o transaction
 protected String transaction(String msg) throws IOException
Makes a transaction to the server. A transaction means sending a message and waiting a reply for it.

Parameters:
msg - the message to be send
Returns:
the reply message from the server
 o setPort
 public void setPort(int value)
Sets the port of the MDS. The default is 1099.

 o getPort
 public int getPort()
Gets the port of the MDS.

 o setDictionaryName
 public void setDictionaryName(String value)
Sets the name of the dictionary.

 o getDictionaryName
 public String getDictionaryName()
Gets the name of the dictionary.


All Packages  Class Hierarchy  This Package  Previous  Next  Index