このエラーの取得:
incompatible types
required: java.lang.Integer
found: java.util.Map.Entry<org.joda.time.DateTime.java.lang.Integer>
そしてエラーになるコード:
public static void checkRange() {
DateTime startx = new DateTime(startDate.getTime());
DateTime endx = new DateTime(endDate.getTime());
//produces submap
Map<DateTime, Integer> nav = map.subMap(startx, endx);
//this is the line causing the error:
for (Integer capacity : map.subMap(startx, endx).entrySet()) {
}
}
}
以前にDateとして定義されたstartDateとendDateを持っていて、DateTimeに見えるようにここで変換します。私はそれが問題だとは思わないし、地図は
public static TreeMap<DateTime, Integer> map = new TreeMap<DateTime, Integer>();
ありがとう、