public Set<String> filterAlleles (int threshold) {
Set<String> filtered = new HashSet<String>();
Map<String, Integer> counted = this.countAlleles();
for (String allele : _alleles){
我以前写过countAlleles方法,所以我在这个方法声明中按照指示使用它。 countAlleles方法返回等位基因和它发生的次数。使用foreach循环打印> =阈值的字符串?
这还应该使用编程语言名称进行标记。 – Bobby
遍历'counting'映射并删除一个值小于阈值的条目(使用'#entrySet'上的'Iterator'),然后打印地图 – Rogue