/**
 * Copyright (C) 2011 - present by OpenGamma Inc. and the OpenGamma group of companies
 *
 * Please see distribution for license.
 */
package com.opengamma.financial.conversion;

import java.util.HashMap;
import java.util.Map;

import com.opengamma.financial.analytics.LabelledMatrix1D;

/**
 * 
 */
public class LabelledMatrix1DConverter implements ResultConverter<LabelledMatrix1D<?, ?>> {

  @Override
  public Map<String, Double> convert(String valueName, LabelledMatrix1D<?, ?> value) {
    Map<String, Double> returnValue = new HashMap<String, Double>();
    Object[] keys = value.getKeys();
    double[] values = value.getValues();

    for (int i = 0; i < values.length; i++) {
      Object k = keys[i];
      double v = values[i];
      returnValue.put(k.toString(), v);
    }
    return returnValue;
  }

  @Override
  public Class<?> getConvertedClass() {
    return LabelledMatrix1D.class;
  }
  
}

@@ -636,17 +636,16 @@
 lues();%0A
-%0A
     for 
@@ -758,16 +758,34 @@
 lue.put(
+valueName + %22%5B%22 + 
 k.toStri
@@ -788,16 +788,22 @@
 String()
+ + %22%5D%22
 , v);%0A  

Include valueName in results for consistency with other converters