
abstract class ExparBin extends ExpAr {

    ExpAr og,od;

    abstract int operate(int operg, int operd) throws ExceptionDivisionParZero;

    int valeurCellule(Coord base, Cellule env[][]) throws ErrorException {
        return operate(og.valeurCellule(base, env), od.valeurCellule(base, env));
    }

    Coord[] listeCoord() {
        Coord[] rog = og.listeCoord();
        Coord[] rod = od.listeCoord();
        int nb = 0;
        if (rog != null)
            nb = rog.length;
        if (rod != null)
            nb += rod.length;
        if (nb <= 0)
            return null;
        Coord[] res = new Coord[nb];
        int i = 0;
        if (rog != null) {
            for (i = 0; i < rog.length; i++)
                res[i] = rog[i];
        }
        nb = i;
        if (rod != null) {
            for (i = 0; i < rod.length; i++)
                res[nb + i] = rod[i];
        }
        return res;
    }

    void init(ExpAr g, ExpAr d) {
        og = g;
        od = d;
    }

}

