123456789101112131415161718192021222324252627282930313233343536 |
- /*
- * 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<Object, Interface> 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();
- }
- }
|