/** * @since 2.7 */ public static Map<Integer, Double> parseIntDouble(@Nullable String data) { return parse(data, newIntegerConverter(), newDoubleConverter()); }
/** * @since 2.7 */ public static Map<String, Double> parseStringDouble(@Nullable String data) { return parse(data, newStringConverter(), newDoubleConverter()); }
/** * @since 2.7 */ public static String formatIntDouble(Map<Integer, Double> map) { return format(map, newIntegerConverter(), newDoubleConverter()); }
/** * Adds an existing Distribution to the current one. * It will create the entries if they don't exist. * Can be used to add the values of children resources for example * <br> * The returned distribution will be invalidated in case the given value does not use the same bottom limits * * @param data the data to add to the current one */ public RangeDistributionBuilder add(String data) { Map<Double, Double> map = KeyValueFormat.parse(data, KeyValueFormat.newDoubleConverter(), KeyValueFormat.newDoubleConverter()); if (bottomLimits == null) { Number[] limits = map.keySet().toArray(new Number[map.size()]); init(limits); } else if (!areSameLimits(bottomLimits, map.keySet())) { isValid = false; } if (isValid) { for (Map.Entry<Double, Double> entry : map.entrySet()) { addLimitCount(entry.getKey(), entry.getValue().intValue()); } } return this; }
/** * @since 2.7 */ public static Map<Integer, Double> parseIntDouble(@Nullable String data) { return parse(data, newIntegerConverter(), newDoubleConverter()); }
/** * @since 2.7 */ public static Map<String, Double> parseStringDouble(@Nullable String data) { return parse(data, newStringConverter(), newDoubleConverter()); }
/** * @since 2.7 */ public static Map<String, Double> parseStringDouble(@Nullable String data) { return parse(data, newStringConverter(), newDoubleConverter()); }
/** * @since 2.7 */ public static Map<Integer, Double> parseIntDouble(@Nullable String data) { return parse(data, newIntegerConverter(), newDoubleConverter()); }
/** * @since 2.7 */ public static String formatIntDouble(Map<Integer, Double> map) { return format(map, newIntegerConverter(), newDoubleConverter()); }
/** * @since 2.7 */ public static String formatIntDouble(Map<Integer, Double> map) { return format(map, newIntegerConverter(), newDoubleConverter()); }
/** * Adds an existing Distribution to the current one. * It will create the entries if they don't exist. * Can be used to add the values of children resources for example * <br> * The returned distribution will be invalidated in case the given value does not use the same bottom limits * * @param data the data to add to the current one */ public RangeDistributionBuilder add(String data) { Map<Double, Double> map = KeyValueFormat.parse(data, KeyValueFormat.newDoubleConverter(), KeyValueFormat.newDoubleConverter()); if (bottomLimits == null) { Number[] limits = map.keySet().toArray(new Number[map.size()]); init(limits); } else if (!areSameLimits(bottomLimits, map.keySet())) { isValid = false; } if (isValid) { for (Map.Entry<Double, Double> entry : map.entrySet()) { addLimitCount(entry.getKey(), entry.getValue().intValue()); } } return this; }
/** * Adds an existing Distribution to the current one. * It will create the entries if they don't exist. * Can be used to add the values of children resources for example * <p/> * Since 2.2, the distribution returned will be invalidated in case the * measure given does not use the same bottom limits * * @param measure the measure to add to the current one * @return the current object */ public RangeDistributionBuilder add(@Nullable Measure<String> measure) { if (measure != null && measure.getData() != null) { Map<Double, Double> map = KeyValueFormat.parse(measure.getData(), KeyValueFormat.newDoubleConverter(), KeyValueFormat.newDoubleConverter()); Number[] limits = map.keySet().toArray(new Number[map.size()]); if (bottomLimits == null) { init(limits); } else if (!areSameLimits(bottomLimits, map.keySet())) { isValid = false; } if (isValid) { for (Map.Entry<Double, Double> entry : map.entrySet()) { addLimitCount(entry.getKey(), entry.getValue().intValue()); } } } return this; }