public class bla {
public static void main(String[] args) {
System.out.println();
List liste = new LinkedList();
liste.add("1 10 20");
liste.add("2 22 33");
liste.add("2 22 33");
liste.add("3 11 05");
liste.add("5 44 55");
for (Iterator iter = liste.iterator(); iter.hasNext();) {
System.out.println("Alte liste: "+ iter.next());
}
liste = bla.filter(liste);
for (Iterator iter = liste.iterator(); iter.hasNext();) {
System.out.println("Neue Liste: "+ iter.next());
}
}
public static List filter(List liste){
List list2 = new LinkedList();
Iterator i = liste.iterator();
while(i.hasNext()){
String s = i.next().toString();
if(!list2.contains(s))list2.add(s);
}
return list2;
}
}