/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package controller; import java.util.HashMap; /** * * @author jechowma68968 */ public class Invoker { private HashMap commands; public Invoker() { commands = new HashMap<>(); } /** * * @param key ist das Object * @param value ist auch etwas */ public void addCommand(Object key, Interface value){ commands.put(key, value); } public void executeCommand(Object key){ commands.get(key).execute(); } }