java在集合中对集合进行分组

public List> getGroupList()
    {
     List> list = new ArrayList>();
     List synsetcnList = groupBySynsetId();
     for(Synsetcn syn : synsetcnList)
  {
   if(syn.getSynset_id().startsWith("9")){
    List tempList = new ArrayList();
    tempList.add(syn);
    String [] chineses = syn.getChinese() == null?new String[0]:syn.getChinese().split(" \\|\\|");
    for(String str :chineses){
     for(Synsetcn syntmp : synsetcnList)
     {
      if(syntmp.getSynset_id().startsWith("7")){
       String [] chs = syntmp.getChinese() == null?new String[0]:syntmp.getChinese().split(" \\|\\|");
       List chsList = new ArrayList();
       for (String s :chs) {
        chsList.add(s);
       }
       if(chsList.contains(str) && !tempList.contains(syntmp)){
        tempList.add(syntmp);
       }
      }
     }
    }
    list.add(tempList);
   }
  }
     return list;
    }

你可能感兴趣的:(java,IO流)