Example #1
0
 // Returns the counts from the mapping, in the same order as the labels
 double[] amounts(HashMap map, String[] revisedLabels) {
   // Extract amounts
   double[] amounts = new double[map.size()];
   for (int i = 0; i < amounts.length; i++)
     amounts[i] = ((Double) (map.get(revisedLabels[i]))).doubleValue();
   return amounts;
 }
Example #2
0
 // Sorts labels from the mapping.  We may get rid of this later perhaps.
 String[] revisedLabels(HashMap map) {
   // Sort labels
   String[] labels = new String[map.size()];
   labels = (String[]) (map.keySet().toArray(labels));
   Arrays.sort(labels);
   return labels;
 }