统计匹配检索规则的物品数量
public int countMatches(List<List<String>> items, String ruleKey, String ruleValue) {
//索引位置
int index=-1;
//匹配数
int num = 0;
if (ruleKey.equals("type")){
index = 0;
}else if (ruleKey.equals("color")){
index = 1;
}else if (ruleKey.equals("name")){
index = 2;
}
for (int i = 0;i<items.size();i++){
if (items.get(i).get(index).equals(ruleValue)){
num++;
}
}
return num;
}