I am iterating through a map whose keys are charts and values are data sets which will be displayed on charts. Data sets are lists of maps because I have multiple XYSeries displayed on each of my Charts (one series - one map with x and y values). In some charts x-axis/y-axis values are Doubles, and in others Integers. Thus, my data sets are type < ? extends Number>. What am I doing wrong?
for (Map.Entry<Chart, List<Map<? extends Number, ? extends Number>>> entry : tcInstance.getMapChartDataset().entrySet()) {
switch (entry.getKey().getTitle()) {
case something:
entry.setValue(listOfMaps1);
break;
case something else:
entry.setValue(listOfMaps2);
break;
// other case options
}
}
These are the declarations of lists of maps:
static List<Map<Integer, Double>> listOfMaps1 = new ArrayList<>();
static List<Map<Double, Double>> listOfMaps2 = new ArrayList<>();
I expected values to be set, but instead I got these errors which tell that the method setValue is not applicable for the arguments (List>) (and the same error for the arguments (List>).