|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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.Map
clear
in interface IValueMap
Map.clear()
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map
Map.containsKey(Object)
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map
Map.containsValue(Object)
public java.util.Set entrySet()
entrySet
in interface java.util.Map
Map.entrySet()
public boolean equals(java.lang.Object o)
equals
in interface java.util.Map
equals
in class java.lang.Object
Map.equals(Object)
public java.lang.Object get(java.lang.Object key)
get
in interface java.util.Map
Map.get(Object)
public boolean getBoolean(java.lang.String key) throws StringValueConversionException
IValueMap
boolean
value by key.
getBoolean
in interface IValueMap
key
- the key
StringValueConversionException
IValueMap.getBoolean(String)
public java.lang.CharSequence getCharSequence(java.lang.String key)
IValueMap
CharSequence
by key.
getCharSequence
in interface IValueMap
key
- the key
CharSequence
IValueMap.getCharSequence(String)
public double getDouble(java.lang.String key) throws StringValueConversionException
IValueMap
double
value by key.
getDouble
in interface IValueMap
key
- the key
StringValueConversionException
IValueMap.getDouble(String)
public double getDouble(java.lang.String key, double defaultValue) throws StringValueConversionException
IValueMap
double
value by key, using a default value if not found.
getDouble
in interface IValueMap
key
- the keydefaultValue
- value to use if no value is in this IValueMap
StringValueConversionException
IValueMap.getDouble(String, double)
public Duration getDuration(java.lang.String key) throws StringValueConversionException
IValueMap
Duration
by key.
getDuration
in interface IValueMap
key
- the key
Duration
value
StringValueConversionException
IValueMap.getDuration(String)
public int getInt(java.lang.String key, int defaultValue) throws StringValueConversionException
IValueMap
int
value by key, using a default value if not found.
getInt
in interface IValueMap
key
- the keydefaultValue
- value to use if no value is in this IValueMap
StringValueConversionException
IValueMap.getInt(String, int)
public int getInt(java.lang.String key) throws StringValueConversionException
IValueMap
int
value by key.
getInt
in interface IValueMap
key
- the key
StringValueConversionException
IValueMap.getInt(String)
public java.lang.String getKey(java.lang.String key)
IValueMap
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.
getKey
in interface IValueMap
key
- the key
IValueMap.getKey(String)
public long getLong(java.lang.String key, long defaultValue) throws StringValueConversionException
IValueMap
long
value by key, using a default value if not found.
getLong
in interface IValueMap
key
- the keydefaultValue
- value to use if no value in this IValueMap
StringValueConversionException
IValueMap.getLong(String, long)
public long getLong(java.lang.String key) throws StringValueConversionException
IValueMap
long
value by key.
getLong
in interface IValueMap
key
- the key
StringValueConversionException
IValueMap.getLong(String)
public java.lang.String getString(java.lang.String key, java.lang.String defaultValue)
IValueMap
String
by key, using a default value if not found.
getString
in interface IValueMap
key
- the keydefaultValue
- default value to return if value is null
String
IValueMap.getString(String, String)
public java.lang.String getString(java.lang.String key)
IValueMap
String
by key.
getString
in interface IValueMap
key
- the key
String
IValueMap.getString(String)
public java.lang.String[] getStringArray(java.lang.String key)
IValueMap
String
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 IValueMap
key
- the key
String
array of that keyIValueMap.getStringArray(String)
public StringValue getStringValue(java.lang.String key)
IValueMap
StringValue
object by key.
getStringValue
in interface IValueMap
key
- the key
StringValue
objectIValueMap.getStringValue(String)
public Time getTime(java.lang.String key) throws StringValueConversionException
IValueMap
Time
object by key.
getTime
in interface IValueMap
key
- the key
Time
object
StringValueConversionException
IValueMap.getTime(String)
public boolean isEmpty()
isEmpty
in interface java.util.Map
Map.isEmpty()
public boolean isImmutable()
IValueMap
IValueMap
is immutable.
isImmutable
in interface IValueMap
IValueMap
is immutableIValueMap.isImmutable()
public java.util.Set keySet()
keySet
in interface java.util.Map
Map.keySet()
public IValueMap makeImmutable()
IValueMap
IValueMap
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 IValueMap
IValueMap
IValueMap.makeImmutable()
public java.lang.Object put(java.lang.Object key, java.lang.Object value)
put
in interface java.util.Map
put
in interface IValueMap
Map.put(Object, Object)
public void putAll(java.util.Map map)
putAll
in interface java.util.Map
putAll
in interface IValueMap
Map.putAll(Map)
public java.lang.Object remove(java.lang.Object key)
remove
in interface java.util.Map
remove
in interface IValueMap
Map.remove(Object)
public int size()
size
in interface java.util.Map
Map.size()
public java.util.Collection values()
values
in interface java.util.Map
Map.values()
public java.lang.String toString()
toString
in class java.lang.Object
IValueMap#toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |