public abstract class IlpAbstractValueMap extends Object implements IlpValueMap
The keys and values set to this value map are subject to type conversion,
which is done using the default type converter or a type converter defined
using the method setTypeConverter
.
Compatibility Note: In JViews 8.0, this class was moved from
ilog.cpl.service
to ilog.cpl.util
.
IlpValueMapFunction
Modifier | Constructor and Description |
---|---|
protected |
IlpAbstractValueMap()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
addValue(Object key,
Object value)
Adds a new key-value pair.
|
void |
clear()
Removes all mappings from this map (optional operation).
|
boolean |
containsKey(Object key)
Returns true if this map contains a mapping for the specified
key.
|
boolean |
containsValue(Object value)
Returns true if this map maps one or more keys to the
specified value.
|
Set |
entrySet()
Returns a set view of the mappings contained in this map.
|
boolean |
equals(Object o)
Compares the specified object with this map for equality.
|
Object |
get(Object key)
Returns the value to which this map maps the specified key.
|
Class |
getKeyClass()
Returns the Java type of the keys used in this value map.
|
Object[] |
getKeys()
Returns the keys present in the value map
|
Object |
getKeys(int index)
Returns the key present in the value map at the given index.
|
protected IlpTypeConverter |
getTypeConverter()
Returns the type converter used to convert the received
value to the expected value.
|
Object |
getValue(Object key)
Returns the mapped value associated with a key.
|
Class |
getValueClass()
Returns the Java type of the values returned by this value map.
|
Object[] |
getValues()
Returns the values present in the value map
|
Object |
getValues(int i)
Returns the value present in the value map at the given index.
|
int |
hashCode()
Returns the hash code value for this map.
|
boolean |
isEmpty()
Returns true if this map contains no key-value mappings.
|
Set |
keySet()
Returns a set view of the keys contained in this map.
|
Object |
put(Object key,
Object value)
Associates the specified value with the specified key in this map
(optional operation).
|
void |
putAll(Map t)
Copies all of the mappings from the specified map to this map.
|
Object |
remove(Object key)
Removes the mapping for this key from this map if present.
|
void |
setKeyClass(Class k)
Sets the Java type of the keys used in this value map.
|
void |
setTypeConverter(IlpTypeConverter t)
Sets the type converter used to convert the received value
to the expected value.
|
void |
setValueClass(Class k)
Sets the Java type of the values returned by this value map.
|
int |
size()
Returns the number of key-value mappings in this map.
|
Collection |
values()
Returns a collection view of the values contained in this map.
|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
public void setTypeConverter(IlpTypeConverter t)
t
- Type converter used to convert values set in
the value to the type expected.IlpTypeConverter
protected IlpTypeConverter getTypeConverter()
public void setKeyClass(Class k)
public Class getKeyClass()
getKeyClass
in interface IlpValueMap
public void setValueClass(Class k)
public Class getValueClass()
getValueClass
in interface IlpValueMap
public Object[] getKeys()
public Object getKeys(int index) throws ArrayIndexOutOfBoundsException
index
- Index of the property to be retrieved.ArrayIndexOutOfBoundsException
public Object[] getValues()
public Object getValues(int i) throws ArrayIndexOutOfBoundsException
i
- Index of the property to be retrieved.ArrayIndexOutOfBoundsException
public Object getValue(Object key)
getValue
in interface IlpValueMap
key
- The key associated with the value to retrieve.public boolean addValue(Object key, Object value)
addValue
in interface IlpValueMap
key
- The key for the key-value pair.value
- The value to be added.public int size()
public boolean isEmpty()
public boolean containsKey(Object key)
containsKey
in interface Map
key
- key whose presence in this map is to be tested.ClassCastException
- if the key is of an inappropriate type for
this map.NullPointerException
- if the key is null and this map
does not not permit null keys.public boolean containsValue(Object value)
containsValue
in interface Map
value
- value whose presence in this map is to be tested.public Object get(Object key)
get
in interface Map
key
- key whose associated value is to be returned.ClassCastException
- if the key is of an inappropriate type for
this map.NullPointerException
- key is null and this map does not
not permit null keys.containsKey(Object)
public Object put(Object key, Object value)
put
in interface Map
key
- key with which the specified value is to be associated.value
- value to be associated with the specified key.UnsupportedOperationException
- if the put operation is
not supported by this map.ClassCastException
- if the class of the specified key or value
prevents it from being stored in this map.IllegalArgumentException
- if some aspect of this key or value
prevents it from being stored in this map.NullPointerException
- this map does not permit null
keys or values, and the specified key or value is
null.public Object remove(Object key)
remove
in interface Map
key
- key whose mapping is to be removed from the map.public void putAll(Map t)
public void clear()
public Set keySet()
public Collection values()
public Set entrySet()
This operation is not supported.
entrySet
in interface Map
UnsupportedOperationException
public boolean equals(Object o)
public int hashCode()
hashCode
in interface Map
hashCode
in class Object
Map.Entry.hashCode()
,
Object.hashCode()
,
Object.equals(Object)
© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.