Ejemplo n.º 1
0
 /**
  * Updates an existing value, or adds a new value to the collection
  *
  * @param a_key the key
  * @param a_value the value
  * @author Klaus Meffert
  * @since 2.3
  */
 public void setValue(final Comparable a_key, final Number a_value) {
   final int keyIndex = getIndex(a_key);
   if (keyIndex >= 0) {
     final KeyedValue kv = (KeyedValue) m_data.get(keyIndex);
     kv.setValue(a_value);
   } else {
     final KeyedValue kv = new KeyedValue(a_key, a_value);
     m_data.add(kv);
   }
 }