我一直在追捕他们,以便这样做。
我想要做的是:
我有:
qualifiedCompetitors = new HashMap<String, List<String>>();
分配到散列图的数值是:
String[] events = {"Helicopter", "Amphibious",
"4x4", "Fire Engine"};
String[][] competitors =
{
{"Greg", "Will", "Fleur", "Bill", "Bella", "Sally", "Olive", "Sal", "Dora", "Chas"},
{"Yuri", "Abe", "Tim", "Fleur", "Bonnie", "Vera", "Ed", "Dan", "Jill", "Rose", "Zoe"},
{"Tim", "Fleur", "Will", "Bill", "Bella", "Dan", "Jill", "Rose", "Greg", "Abe", "Sally", "Yuri", "Olive", "Sal", "Jim"},
{"Jill", "Rose", "Greg", "Abe", "Bonnie", "Vera", "Ed", "Zoe", "Ben", "Freda", "Chuck", "Fred"}
};
关键筛选是事件的名称,清单是竞争者名单。 我想建立一个所有竞争者的新名单。
因此,我尝试了诸如:
ListOfAllqualifiedCompetitors = new ArrayList(qualifiedCompetitors.values());
接着通过散列图进行:
Collection allCompetitors = qualifiedCompetitors.values();
System.out.println("Values of Collection created from Hashtable are :");
//iterate through the collection
Iterator itr = allDrivers.iterator();
while(itr.hasNext())
System.out.println(itr.next());
看到我拿到什么东西,什么是罚款,但我不能再增加一个新名单? 我知道我没有什么明显的建议?