package ab;

/** Classe décrivant une énumération infixe d'un arbre binaire. */
public class EnumerationInfixe  extends EnumerationArbre {
  public EnumerationInfixe(ArbreBinaire a) {
    super(a);
    if (this.a.gauche != null) this.eag=new  EnumerationInfixe(this.a.gauche);
    if (this.a.droit != null) this.ead=new  EnumerationInfixe(this.a.droit);
    }

   public Object nextElement() {
     if (this.eag != null && this.eag.hasMoreElements()) 
        return this.eag.nextElement();
     if (!racineEnumeree) {this.racineEnumeree=true;return this.a.racine;}
     if (this.ead != null && this.ead.hasMoreElements()) 
        return this.ead.nextElement();
     return null;
     }
}

