@@ -0,0 +1,2151 @@
+package seedu.doist.logic.commands;%0A%0Aimport java.util.Stack;%0A%0A/**%0A * Class to help maintain a stack of commands that have been entered by the user%0A * @author Ram%0A *%0A */%0A%0Apublic class CommandHistory %7B%0A%0A    /**%0A     * history is the main stack that contains the commands (as strings) entered%0A     * overflow acts as a buffer, when history is popped off but needs to be refilled%0A     * current is the command viewed by the user%0A     */%0A    private static Stack%3CString%3E history = new Stack%3CString%3E();%0A    private static Stack%3CString%3E overflow = new Stack%3CString%3E();%0A    private static String current = null;%0A%0A    public CommandHistory() %7B%0A        history = new Stack%3CString%3E();%0A        overflow = new Stack%3CString%3E();%0A        current = null;%0A    %7D%0A%0A%0A    /**%0A     * Method that pushes new command onto the top of the stack%0A     * @param command%0A     * Returns a boolean if successful%0A     */%0A    public static boolean addCommandHistory(String command) %7B%0A        return history.add(command);%0A    %7D%0A%0A%0A    /**%0A     * Method that returns the previous command entered by user%0A     * Returns null if history is empty%0A     */%0A    public static String getPreviousCommand() %7B%0A        if (history.isEmpty()) %7B%0A            return current;%0A        %7D else %7B%0A            if (current != null) %7B%0A                overflow.push(current);%0A            %7D%0A            current = history.pop();%0A            return current;%0A        %7D%0A    %7D%0A%0A    /**%0A     * Method that returns the next command entered by the user, if it exists%0A     * Returns null if overflow is empty%0A     */%0A    public static String getNextCommand() %7B%0A        if (overflow.isEmpty()) %7B%0A            if (current != null) %7B%0A                history.add(current);%0A            %7D%0A            current = null;%0A            return current;%0A        %7D else %7B%0A            history.add(current);%0A            current = overflow.pop();%0A            return current;%0A        %7D%0A    %7D%0A%0A    public static void restore() %7B%0A        if (current != null) %7B%0A            history.push(current);%0A            while (!overflow.isEmpty()) %7B%0A                history.push(overflow.pop());%0A            %7D%0A            current = null;%0A        %7D%0A    %7D%0A%0A%7D%0A

Add CommandHistory class