import java.util.*; public abstract class Operateur { private static Map ops = new HashMap(); private String nom; private int arite; public Operateur(String nom, int arite) throws OperateurExistantException { Operateur op = (Operateur) ops.get(nom); if (op != null) { throw new OperateurExistantException(op); } this.nom = nom; this.arite = arite; ops.put(nom, this); } public String nom() { return nom; } public static Operateur operateur(String nom) throws OperateurInexistantException { Operateur op = (Operateur) ops.get(nom); if (op == null) { throw new OperateurInexistantException(nom); } return op; } public int arite() { return arite; } public abstract int evaluer(int [] operandes); }