您将如何将给定地图中的所有值加在一起?
private final Map<String, Double> deviceVoltageMap = new HashMap<String, Double>();
synchronized public double getVoltage(String device) {
double totalVolts = 0.0;
for (String key : deviceVoltageMap.keySet()) {
//?
}
return totalVolts;
}