【发布时间】:2016-11-04 17:59:56
【问题描述】:
public Set<String> filterAlleles (int threshold) {
Set<String> filtered = new HashSet<String>();
Map<String, Integer> counted = this.countAlleles();
for (String allele : _alleles){
我之前编写了 countAlleles 方法,所以我按照说明在此方法声明中使用它。 countAlleles 方法返回等位基因和它发生的次数。
【问题讨论】:
-
这也应该用编程语言名称标记。
-
迭代
counted映射并删除值小于阈值的条目(在#entrySet上使用Iterator),然后打印映射
标签: java string foreach filter