org.formaria.editor.langed
Class EdLanguage

java.lang.Object
  extended by org.formaria.editor.langed.EdLanguage

public class EdLanguage
extends java.lang.Object

EdLanguage Extends the basic language class to provide write functionality.

Copyright (c) Formaria Ltd., 2001-2006, This software is licensed under the GNU Public License (GPL), please see license.txt for more details. If you make commercial use of this software you must purchase a commercial license from Formaria.

$Revision: 1.11 $


Constructor Summary
EdLanguage(EdLangMgr lm)
           
 
Method Summary
 int addString(int id, java.lang.String newKeyStr, java.lang.String newValueStr)
          Add a new string to the language.
 int addString(java.lang.String newKeyStr, java.lang.String newValueStr)
          Add a new string to the language.
 int findString(java.lang.String key)
          Looks up and returns a string.
 java.lang.Object getElementAt(int idx)
           
 java.lang.String getLangCode()
          Gets the language country code e.g.
 java.lang.String getLangName()
          Gets the language name e.g.
 int getMaxId()
          Gets the maximum string ID in use.
 int getNumStrings()
           
 int getSize()
           
 java.lang.String getString(int id)
           
 java.lang.String getStringAt(int idx)
           
 int getStringId(int idx)
           
 int getStringIndex(int idx)
           
 void read(java.util.Vector translations, int field, boolean bSubstrings)
           
 void removeString(int idx)
           
 void saveProperties(java.lang.String newFile, java.lang.String encoding)
           
 void setKeyString(int id, java.lang.String newStr)
          Looks up and returns a string.
 void setLangCode(java.lang.String cc)
          Sets the language country code e.g.
 void setLangName(java.lang.String name)
          Sets the language name e.g.
 void setString(int id, java.lang.String newKeyStr, java.lang.String newValueStr)
          Looks up and returns a string.
 void sort(java.util.Comparator c)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EdLanguage

public EdLanguage(EdLangMgr lm)
Method Detail

getLangName

public java.lang.String getLangName()
Gets the language name e.g. "English"


setLangName

public void setLangName(java.lang.String name)
Sets the language name e.g. "English"

Parameters:
name - The new language name.

getLangCode

public java.lang.String getLangCode()
Gets the language country code e.g. "IRL"


setLangCode

public void setLangCode(java.lang.String cc)
Sets the language country code e.g. "IRL"

Parameters:
cc - The new language code.

getStringAt

public java.lang.String getStringAt(int idx)

getElementAt

public java.lang.Object getElementAt(int idx)

getNumStrings

public int getNumStrings()

read

public void read(java.util.Vector translations,
                 int field,
                 boolean bSubstrings)

getSize

public int getSize()

getString

public java.lang.String getString(int id)

findString

public int findString(java.lang.String key)
Looks up and returns a string.


getStringId

public int getStringId(int idx)

getStringIndex

public int getStringIndex(int idx)

setString

public void setString(int id,
                      java.lang.String newKeyStr,
                      java.lang.String newValueStr)
Looks up and returns a string.

Parameters:
newKeyStr - the new language key
newValueStr - the new language value

setKeyString

public void setKeyString(int id,
                         java.lang.String newStr)
Looks up and returns a string.


addString

public int addString(int id,
                     java.lang.String newKeyStr,
                     java.lang.String newValueStr)
Add a new string to the language.

Parameters:
id - the id of this new language string
newKeyStr - the new langauge key
newValueStr - the new langauge value

addString

public int addString(java.lang.String newKeyStr,
                     java.lang.String newValueStr)
Add a new string to the language.

Parameters:
newKeyStr - the new langauge key
newValueStr - the new langauge value

getMaxId

public int getMaxId()
Gets the maximum string ID in use.

Returns:

removeString

public void removeString(int idx)

saveProperties

public void saveProperties(java.lang.String newFile,
                           java.lang.String encoding)
                    throws java.io.IOException
Throws:
java.io.IOException

sort

public void sort(java.util.Comparator c)