de.cbse.jeasy
Class JELocaleProperties

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap
          extended by de.cbse.jeasy.JELocaleProperties
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map

public class JELocaleProperties
extends java.util.HashMap

This calls extends a HashMap for holding properties as a key <-> value reference. If a locale is active, storing and reading depends on this locale. That means you may store the same key with different values for different locales. See a demonstration in the program JEasyExample tab "Locale".

Author:
Harry Pfohl
See Also:
Serialized Form

Constructor Summary
JELocaleProperties()
           
JELocaleProperties(java.util.HashMap hashmap)
           
JELocaleProperties(JELocaleProperties propertyHashMap)
           
 
Method Summary
 java.lang.Object get(JELocale jel, java.lang.Object key)
          Returns the locale value to which the specified key is mapped,
 java.lang.Object get(java.lang.Object key)
          Returns the value to which the specified key is mapped,
 java.lang.Object get(java.lang.String locale, java.lang.Object key)
          Returns the locale value to which the specified key is mapped,
 java.util.HashMap getHashMap()
          Gets the default (not localized) HashMap.
 java.lang.Object put(java.lang.String key, java.lang.Object value)
          Associates the specified value with the specified key in this map.
 java.lang.Object put(java.lang.String locale, java.lang.String key, java.lang.Object value)
          Associates the specified value with the specified key in the locale map.
 java.lang.Object remove(JELocale jel, java.lang.String key)
           
 java.lang.Object remove(java.lang.Object key)
          Returns the value to which the specified key is mapped,
 java.lang.Object remove(java.lang.String locale, java.lang.String key)
          Removes a locale key from the locale HashMap.
 java.lang.String toString()
           
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, isEmpty, keySet, put, putAll, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode
 
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

JELocaleProperties

public JELocaleProperties(JELocaleProperties propertyHashMap)

JELocaleProperties

public JELocaleProperties()

JELocaleProperties

public JELocaleProperties(java.util.HashMap hashmap)
Method Detail

put

public java.lang.Object put(java.lang.String key,
                            java.lang.Object value)
Associates the specified value with the specified key in this map. If the locale was set (JEObject.setJeLocale(jeLocale)) the entry will be stored regarding the locale.

Parameters:
key -
value -
Returns:

put

public java.lang.Object put(java.lang.String locale,
                            java.lang.String key,
                            java.lang.Object value)
Associates the specified value with the specified key in the locale map.

Parameters:
locale -
key -
value -
Returns:

get

public java.lang.Object get(java.lang.Object key)
Returns the value to which the specified key is mapped,

Specified by:
get in interface java.util.Map
Overrides:
get in class java.util.HashMap
Parameters:
key - the value to which the specified key is mapped, or null if this map contains no mapping for the key

get

public java.lang.Object get(java.lang.String locale,
                            java.lang.Object key)
Returns the locale value to which the specified key is mapped,

Parameters:
key - the value to which the specified key is mapped, or null if this map contains no mapping for the key

get

public java.lang.Object get(JELocale jel,
                            java.lang.Object key)
Returns the locale value to which the specified key is mapped,

Parameters:
key - the value to which the specified key is mapped, or null if this map contains no mapping for the key

getHashMap

public java.util.HashMap getHashMap()
Gets the default (not localized) HashMap.

Returns:

remove

public java.lang.Object remove(JELocale jel,
                               java.lang.String key)

remove

public java.lang.Object remove(java.lang.String locale,
                               java.lang.String key)
Removes a locale key from the locale HashMap. If locale is null the key will be removed from the default HashMap.

Parameters:
locale -
key -

remove

public java.lang.Object remove(java.lang.Object key)
Returns the value to which the specified key is mapped,

Specified by:
remove in interface java.util.Map
Overrides:
remove in class java.util.HashMap
Parameters:
key - the value to which the specified key is mapped, or null if this map contains no mapping for the key

toString

public java.lang.String toString()
Overrides:
toString in class java.util.AbstractMap