org.dasein.util
Class Translator<T>
java.lang.Object
org.dasein.util.PseudoMap<Locale,Translation<T>>
org.dasein.util.Translator<T>
- All Implemented Interfaces:
- Serializable, Map<Locale,Translation<T>>, DelegatedComparable
public class Translator<T>
- extends PseudoMap<Locale,Translation<T>>
- implements DelegatedComparable, Serializable
Last modified: $Date
- Version:
- $Revision: 1.3 $
- Author:
- George Reese (http://george.reese.name)
- See Also:
- Serialized Form
| Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
Translator
public Translator(Map<Locale,T> trans)
Translator
public Translator(Locale loc,
T msg)
parseLocale
public static Locale parseLocale(String iso)
containsKey
public boolean containsKey(Object key)
- Specified by:
containsKey in interface Map<Locale,Translation<T>>
containsValue
public boolean containsValue(Object val)
- Specified by:
containsValue in interface Map<Locale,Translation<T>>
copy
public Translator<T> copy()
entrySet
public Set<Map.Entry<Locale,Translation<T>>> entrySet()
- Specified by:
entrySet in interface Map<Locale,Translation<T>>
equals
public boolean equals(Object ob)
- Specified by:
equals in interface Map<Locale,Translation<T>>- Overrides:
equals in class Object
get
public Translation<T> get(Object key)
- Specified by:
get in interface Map<Locale,Translation<T>>
get
public Translation<T> get(Collection<Locale> locales)
getAnyTranslation
public Translation<T> getAnyTranslation()
getBestTranslation
public Translation<T> getBestTranslation(String lang)
getBestTranslation
public Translation<T> getBestTranslation(String lang,
String ctry)
getBestTranslation
public Translation<T> getBestTranslation(Locale loc)
getDelegate
public Object getDelegate(Locale loc)
- Specified by:
getDelegate in interface DelegatedComparable
getExactTranslation
public Translation<T> getExactTranslation(Locale loc)
getTranslation
public Translation<T> getTranslation(Locale loc)
getTranslation
public Translation<T> getTranslation(Collection<Locale> locales)
getTranslation
public Translation<T> getTranslation(String lang,
String ctry)
hashCode
public int hashCode()
- Specified by:
hashCode in interface Map<Locale,Translation<T>>- Overrides:
hashCode in class Object
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty in interface Map<Locale,Translation<T>>
keySet
public Set<Locale> keySet()
- Specified by:
keySet in interface Map<Locale,Translation<T>>
countries
public Iterator<String> countries(String lang)
languages
public Iterator<String> languages()
newTranslator
public Translator<T> newTranslator(Translator<T> t)
newTranslator
public Translator<T> newTranslator(Locale loc,
T val)
newTranslator
public Translator<T> newTranslator(Map<String,Map<String,T>> additional)
size
public int size()
- Specified by:
size in interface Map<Locale,Translation<T>>
toMap
public Map<Locale,? extends Object> toMap()
toString
public String toString()
- Overrides:
toString in class Object
values
public Collection<Translation<T>> values()
- Specified by:
values in interface Map<Locale,Translation<T>>