eu.etaxonomy.cdm.model.common
Class MultilanguageText

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<Language,LanguageString>
          extended by eu.etaxonomy.cdm.model.common.MultilanguageText
All Implemented Interfaces:
IMultiLanguageText, Serializable, Cloneable, Map<Language,LanguageString>

public class MultilanguageText
extends HashMap<Language,LanguageString>
implements Cloneable, IMultiLanguageText

Author:
m.doering Special array that takes care that all LanguageString elements have a unique language
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Constructor Summary
  MultilanguageText()
           
  MultilanguageText(int initialCapacity, float loadFactor)
           
protected MultilanguageText(LanguageString languageString)
          Constructor
 
Method Summary
 LanguageString add(LanguageString languageString)
          Deprecated. 
 MultilanguageText clone()
          Clones this multi-language text.
 LanguageString getPreferredLanguageString(List<Language> languages)
          Iterates on the languages.
 String getText(Language language)
           
static MultilanguageText NewInstance()
          Factory method
static MultilanguageText NewInstance(LanguageString languageString)
          Factory method
 LanguageString put(LanguageString languageString)
           
 
Methods inherited from class java.util.HashMap
clear, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

MultilanguageText

public MultilanguageText()

MultilanguageText

protected MultilanguageText(LanguageString languageString)
Constructor


MultilanguageText

public MultilanguageText(int initialCapacity,
                         float loadFactor)
Method Detail

NewInstance

public static MultilanguageText NewInstance()
Factory method

Returns:

NewInstance

public static MultilanguageText NewInstance(LanguageString languageString)
Factory method

Returns:

getText

public String getText(Language language)
Specified by:
getText in interface IMultiLanguageText
Returns:

add

@Deprecated
public LanguageString add(LanguageString languageString)
Deprecated. 

Specified by:
add in interface IMultiLanguageText
Returns:
String the previous text in the MultilanguageSet that was associated with the language defined in languageString, or null if there was no such text before. (A null return can also indicate that the text was previously null.)

put

public LanguageString put(LanguageString languageString)
Specified by:
put in interface IMultiLanguageText
Returns:
String the previous text in the MultilanguageSet that was associated with the language defined in languageString, or null if there was no such text before. (A null return can also indicate that the text was previously null.)

getPreferredLanguageString

public LanguageString getPreferredLanguageString(List<Language> languages)
Description copied from interface: IMultiLanguageText
Iterates on the languages. As soon as there exists a language string for this language in this multilanguage text it is returned.

Specified by:
getPreferredLanguageString in interface IMultiLanguageText
Returns:

clone

public MultilanguageText clone()
Clones this multi-language text. This is a shortcut that enables to create a new instance that differs only slightly from this multi-language text by modifying only some of the attributes.
This method overrides the clone method from DerivedUnitBase.

Overrides:
clone in class HashMap<Language,LanguageString>
See Also:
DerivedUnitBase.clone(), IdentifiableMediaEntity.clone(), Object.clone()


Copyright © 2007-2013 EDIT. All Rights Reserved.