@@ -0,0 +1,1645 @@
+package jfdi.logic;%0A%0Aimport jfdi.logic.commands.ListCommand;%0Aimport jfdi.logic.interfaces.ILogic;%0Aimport jfdi.storage.records.Task;%0A%0Aimport java.util.Collection;%0A%0A/**%0A * @author Liu Xinan%0A */%0Apublic class ControlCenter implements ILogic %7B%0A%0A    private static ControlCenter ourInstance = new ControlCenter();%0A%0A    private ControlCenter() %7B%0A    %7D%0A%0A    public static ControlCenter getInstance() %7B%0A        return ourInstance;%0A    %7D%0A%0A    @Override%0A    public void handleInput(String input) %7B%0A        // TODO: Integrate when parser is ready.%0A        // Right now it is executing a ListCommand no matter what the input is.%0A        ListCommand.Builder builder = new ListCommand.Builder();%0A        builder.addTag(%22important%22);%0A        builder.addTag(%22urgent%22);%0A        ListCommand ls = builder.build();%0A        ls.execute();%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        // An example of using ControlCenter and commands.%0A%0A        ListCommand.addSuccessHook(command -%3E %7B%0A            Collection%3CTask%3E items = command.getItems();%0A            for (Task item : items) %7B%0A                System.out.printf(%22%25d. %25s%5Cn%22, item.getId(), item.getDescription());%0A            %7D%0A        %7D);%0A%0A        ListCommand.addFailureHook(command -%3E %7B%0A            switch (command.getErrorType()) %7B%0A                case NON_EXISTENT_TAG:%0A                    break;%0A                case UNKNOWN:%0A                    System.out.println(%22Uh-oh%22);%0A                    break;%0A                default: break;%0A            %7D%0A        %7D);%0A%0A        ControlCenter cc = ControlCenter.getInstance();%0A        cc.handleInput(%22anything%22);%0A        // Uh-oh%0A        // It works!%0A    %7D%0A%7D%0A

Implement `ControlCenter`