Class Translations


  • public class Translations
    extends java.lang.Object
    class contains and handles translations from the CR or default Magellan translations. Is part of GameData thinking about to make it "Localized"
    Version:
    1.0, 20.11.2007
    • Constructor Summary

      Constructors 
      Constructor Description
      Translations()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addAll​(Translations translations, Rules rules)
      adds the complete translations to this translations the actual contents is not cleared!
      void addTranslation​(java.lang.String original, java.lang.String translated, int source)
      Adds a new Translation
      void clear()
      clear complete contents of the Translations
      boolean contains​(java.lang.String s)
      Returns true if given String is already in this translations.
      java.util.TreeSet<java.lang.String> getKeyTreeSet()
      provides a sorted set of the keys
      java.lang.String getTranslation​(java.lang.String original)
      returns the translated string source is not important
      java.lang.String getTranslation​(java.lang.String original, int source)
      returns the translated string, if it is from the specified source.
      TranslationType getTranslationType​(java.lang.String original)
      returns the translated string
      java.util.Iterator<java.lang.String> iteratorKeys()
      provides an Iterator over the keys = original strings
      void remove​(java.lang.String o)
      removes an Translation
      int size()
      returns the size of the translations object (number of translations)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Translations

        public Translations()
    • Method Detail

      • getTranslation

        public java.lang.String getTranslation​(java.lang.String original)
        returns the translated string source is not important
        Parameters:
        original -
        Returns:
        the translated string; if the original was not found, the original is returned.
      • getTranslationType

        public TranslationType getTranslationType​(java.lang.String original)
        returns the translated string
        Parameters:
        original -
      • clear

        public void clear()
        clear complete contents of the Translations
      • addAll

        public void addAll​(Translations translations,
                           Rules rules)
        adds the complete translations to this translations the actual contents is not cleared!
        Parameters:
        translations -
      • iteratorKeys

        public java.util.Iterator<java.lang.String> iteratorKeys()
        provides an Iterator over the keys = original strings
      • size

        public int size()
        returns the size of the translations object (number of translations)
      • getKeyTreeSet

        public java.util.TreeSet<java.lang.String> getKeyTreeSet()
        provides a sorted set of the keys
      • remove

        public void remove​(java.lang.String o)
        removes an Translation
        Parameters:
        o -
      • contains

        public boolean contains​(java.lang.String s)
        Returns true if given String is already in this translations.
        Parameters:
        s -