Es funktioniert, aber fragt nich warum, wie und wofür!

public Map, Set > match(LabelList matchList){
   Map> matchMap = new HashMap>();
   for(Iterator ourElement = iterator(); ourElement.hasNext();) {
    String ourLabel = (String) ourElement.next();
    Set matchSet = new HashSet();
       for(Iterator otherElement = matchList.iterator(); otherElement.hasNext();) {
        String otherLabel = (String) otherElement.next();
        if (transformString(otherLabel).contains(transformString(ourLabel))){
         matchSet.add(otherLabel);
        }
       }
    if (!matchSet.isEmpty()) {
     matchMap.put(ourLabel,matchSet);
    }
   }
   return matchMap;
 }

dank blogger fehlen natürlich ein paar Zeichen...

About this entry