|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.wicket.util.value.CopyOnWriteValueMap
public class CopyOnWriteValueMap
An implementation of IValueMap that makes a copy when a caller tries to change an
immutable Map. That is, the Map may or may not be immutable, but
if it is, a copy is made.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
java.util.Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
CopyOnWriteValueMap(IValueMap wrapped)
Constructor. |
|
| Method Summary | |
|---|---|
void |
clear()
|
boolean |
containsKey(java.lang.Object key)
|
boolean |
containsValue(java.lang.Object value)
|
java.util.Set |
entrySet()
|
boolean |
equals(java.lang.Object o)
|
java.lang.Object |
get(java.lang.Object key)
|
boolean |
getBoolean(java.lang.String key)
Retrieves a boolean value by key. |
java.lang.CharSequence |
getCharSequence(java.lang.String key)
Retrieves a CharSequence by key. |
double |
getDouble(java.lang.String key)
Retrieves a double value by key. |
double |
getDouble(java.lang.String key,
double defaultValue)
Retrieves a double value by key, using a default value if not found. |
Duration |
getDuration(java.lang.String key)
Retrieves a Duration by key. |
int |
getInt(java.lang.String key)
Retrieves an int value by key. |
int |
getInt(java.lang.String key,
int defaultValue)
Retrieves an int value by key, using a default value if not found. |
java.lang.String |
getKey(java.lang.String key)
Provided that the hash key is a String and you need to access the value
ignoring the key's case (upper- or lowercase letters), then you may use this method to get
the correct writing. |
long |
getLong(java.lang.String key)
Retrieves a long value by key. |
long |
getLong(java.lang.String key,
long defaultValue)
Retrieves a long value by key, using a default value if not found. |
java.lang.String |
getString(java.lang.String key)
Retrieves a String by key. |
java.lang.String |
getString(java.lang.String key,
java.lang.String defaultValue)
Retrieves a String by key, using a default value if not found. |
java.lang.String[] |
getStringArray(java.lang.String key)
Retrieves a String array by key. |
StringValue |
getStringValue(java.lang.String key)
Retrieves a StringValue object by key. |
Time |
getTime(java.lang.String key)
Retrieves a Time object by key. |
boolean |
isEmpty()
|
boolean |
isImmutable()
Returns whether or not this IValueMap is immutable. |
java.util.Set |
keySet()
|
IValueMap |
makeImmutable()
Makes this IValueMap immutable by changing the underlying map representation
to a Collections.unmodifiableMap. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
|
void |
putAll(java.util.Map map)
|
java.lang.Object |
remove(java.lang.Object key)
|
int |
size()
|
java.lang.String |
toString()
|
java.util.Collection |
values()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Map |
|---|
hashCode |
| Constructor Detail |
|---|
public CopyOnWriteValueMap(IValueMap wrapped)
wrapped - the wrapped IValueMap| Method Detail |
|---|
public void clear()
clear in interface java.util.Mapclear in interface IValueMapMap.clear()public boolean containsKey(java.lang.Object key)
containsKey in interface java.util.MapMap.containsKey(Object)public boolean containsValue(java.lang.Object value)
containsValue in interface java.util.MapMap.containsValue(Object)public java.util.Set entrySet()
entrySet in interface java.util.MapMap.entrySet()public boolean equals(java.lang.Object o)
equals in interface java.util.Mapequals in class java.lang.ObjectMap.equals(Object)public java.lang.Object get(java.lang.Object key)
get in interface java.util.MapMap.get(Object)
public boolean getBoolean(java.lang.String key)
throws StringValueConversionException
IValueMapboolean value by key.
getBoolean in interface IValueMapkey - the key
StringValueConversionExceptionIValueMap.getBoolean(String)public java.lang.CharSequence getCharSequence(java.lang.String key)
IValueMapCharSequence by key.
getCharSequence in interface IValueMapkey - the key
CharSequenceIValueMap.getCharSequence(String)
public double getDouble(java.lang.String key)
throws StringValueConversionException
IValueMapdouble value by key.
getDouble in interface IValueMapkey - the key
StringValueConversionExceptionIValueMap.getDouble(String)
public double getDouble(java.lang.String key,
double defaultValue)
throws StringValueConversionException
IValueMapdouble value by key, using a default value if not found.
getDouble in interface IValueMapkey - the keydefaultValue - value to use if no value is in this IValueMap
StringValueConversionExceptionIValueMap.getDouble(String, double)
public Duration getDuration(java.lang.String key)
throws StringValueConversionException
IValueMapDuration by key.
getDuration in interface IValueMapkey - the key
Duration value
StringValueConversionExceptionIValueMap.getDuration(String)
public int getInt(java.lang.String key,
int defaultValue)
throws StringValueConversionException
IValueMapint value by key, using a default value if not found.
getInt in interface IValueMapkey - the keydefaultValue - value to use if no value is in this IValueMap
StringValueConversionExceptionIValueMap.getInt(String, int)
public int getInt(java.lang.String key)
throws StringValueConversionException
IValueMapint value by key.
getInt in interface IValueMapkey - the key
StringValueConversionExceptionIValueMap.getInt(String)public java.lang.String getKey(java.lang.String key)
IValueMapString and you need to access the value
ignoring the key's case (upper- or lowercase letters), then you may use this method to get
the correct writing.
getKey in interface IValueMapkey - the key
IValueMap.getKey(String)
public long getLong(java.lang.String key,
long defaultValue)
throws StringValueConversionException
IValueMaplong value by key, using a default value if not found.
getLong in interface IValueMapkey - the keydefaultValue - value to use if no value in this IValueMap
StringValueConversionExceptionIValueMap.getLong(String, long)
public long getLong(java.lang.String key)
throws StringValueConversionException
IValueMaplong value by key.
getLong in interface IValueMapkey - the key
StringValueConversionExceptionIValueMap.getLong(String)
public java.lang.String getString(java.lang.String key,
java.lang.String defaultValue)
IValueMapString by key, using a default value if not found.
getString in interface IValueMapkey - the keydefaultValue - default value to return if value is null
StringIValueMap.getString(String, String)public java.lang.String getString(java.lang.String key)
IValueMapString by key.
getString in interface IValueMapkey - the key
StringIValueMap.getString(String)public java.lang.String[] getStringArray(java.lang.String key)
IValueMapString array by key. If the value was a String[] it
will be returned directly. If it was a String it will be converted to a
String array of length one. If it was an array of another type, a
String array will be made and each element will be converted to a
String.
getStringArray in interface IValueMapkey - the key
String array of that keyIValueMap.getStringArray(String)public StringValue getStringValue(java.lang.String key)
IValueMapStringValue object by key.
getStringValue in interface IValueMapkey - the key
StringValue objectIValueMap.getStringValue(String)
public Time getTime(java.lang.String key)
throws StringValueConversionException
IValueMapTime object by key.
getTime in interface IValueMapkey - the key
Time object
StringValueConversionExceptionIValueMap.getTime(String)public boolean isEmpty()
isEmpty in interface java.util.MapMap.isEmpty()public boolean isImmutable()
IValueMapIValueMap is immutable.
isImmutable in interface IValueMapIValueMap is immutableIValueMap.isImmutable()public java.util.Set keySet()
keySet in interface java.util.MapMap.keySet()public IValueMap makeImmutable()
IValueMapIValueMap immutable by changing the underlying map representation
to a Collections.unmodifiableMap. After calling this method, any attempt to
modify this IValueMap will result in a RuntimeException being
thrown by the Collections framework.
makeImmutable in interface IValueMapIValueMapIValueMap.makeImmutable()
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
put in interface java.util.Mapput in interface IValueMapMap.put(Object, Object)public void putAll(java.util.Map map)
putAll in interface java.util.MapputAll in interface IValueMapMap.putAll(Map)public java.lang.Object remove(java.lang.Object key)
remove in interface java.util.Mapremove in interface IValueMapMap.remove(Object)public int size()
size in interface java.util.MapMap.size()public java.util.Collection values()
values in interface java.util.MapMap.values()public java.lang.String toString()
toString in class java.lang.ObjectIValueMap#toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||