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