public class IlpDefaultValueMap extends HashMap implements IlpValueMap
Note that this implementation does not ensure consistency between the key and value type declaration and the content of the map itself.
Compatibility Note: In JViews 8.0, this class was moved from
ilog.cpl.service
to ilog.cpl.util
.
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
IlpDefaultValueMap(Class keyClass,
Class valueClass)
Constructs a new, empty mapping.
|
IlpDefaultValueMap(Class keyClass,
Class valueClass,
Map map)
Constructs a new mapping from the given map.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addValue(Object key,
Object value)
Adds a new key-value set.
|
Object |
clone()
Returns a shallow copy of this instance: the keys and values
themselves are not cloned.
|
Class |
getKeyClass()
Returns the Java type of the keys used in this mapping.
|
Object |
getValue(Object key)
Returns the value of the mapping for a specific key.
|
Class |
getValueClass()
Returns the type of the values returned by this mapping.
|
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
equals, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, get, getOrDefault, hashCode, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
public IlpDefaultValueMap(Class keyClass, Class valueClass)
keyClass
- The Java type of the keys in the mapping.valueClass
- The Java type of the values returned by the mapping.public IlpDefaultValueMap(Class keyClass, Class valueClass, Map map)
keyClass
- The Java type of the keys in the mapping.valueClass
- The Java type of the values returned by the mapping.map
- The map to be copied into this one.public Object clone()
public Class getKeyClass()
getKeyClass
in interface IlpValueMap
public Class getValueClass()
Object
.getValueClass
in interface IlpValueMap
public Object getValue(Object key)
getValue
in interface IlpValueMap
key
- The key for which to get the value.public boolean addValue(Object key, Object value)
addValue
in interface IlpValueMap
key
- The key for the mapping. The key may be null.value
- The value to be added. The value may be null.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.