如何从 Map<String,Map<Date,Statistics>> 向 Vaadin table 添加行?

How to add rows to Vaadin table from a Map<String,Map<Date,Statistics>>?

我有一个 Collection 作为:

Map<String,Map<Date,Statistics>> map;

统计数据看起来像这样:

    private final Date day;
    private int count;
    private long totalTime;
    private Map<Integer, BigDecimal> averagesMap = new HashMap<Integer, BigDecimal>();

因此 map 的条目和值类似于:

nameOne, 03.03.2015, statisticsOne
nameOne, 03.04.2015, statisticsTwo
nameTwo, 03.02.2014, statisticsThree

等..

假设 statisticsOne 看起来像这样:

day = 03.03.2015
count = 5
totalTime = 50
avaragesMap = {3:20;5:70}

现在我如何向 Vaadin 添加一行 Table 所以我看到这样的东西:

nameOne 03.03.2015 5 50 3 20
nameOne 03.03.2015 5 50 5 70

?

我会在您的 Map averagesMap 结构周围制作一个包装器 class,它可以 return 类似于 List

这样您就可以使用 BeanItemContainer 来显示您的内容。