import java.util.Iterator; import arbre.Arbre; import arbre.Fonction; /* * Created on 15 nov. 2004 * */ /** * @author baudon * */ public class Test { public static void main(String[] args) { Arbre a = new Arbre(new Arbre(new Arbre(null, null, "1"), new Arbre(null, null, "2"), "3"), new Arbre(null, null, "4"), "5"); for (Iterator it = a.iteration(); it.hasNext();) { System.out.print(it.next() + " "); } System.out.println(); final StringBuffer s = new StringBuffer(); a.appliquer(new Fonction() { public boolean f(String o) { s.append(o + " "); return !o.equals("3"); } }); System.out.println(s); } }