package seedu.todo.controllers;

import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.Date;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import com.joestelmach.natty.DateGroup;
import com.joestelmach.natty.Parser;

import seedu.todo.commons.EphemeralDB;
import seedu.todo.controllers.concerns.Renderer;
import seedu.todo.models.CalendarItem;
import seedu.todo.models.TodoListDB;

/**
 * @@author A0093907W
 * 
 * Controller to update a CalendarItem.
 */
public class UpdateController implements Controller {
    
    private static final String NAME = "Update";
    private static final String DESCRIPTION = "Updates a task by listed index.";
    private static final String COMMAND_SYNTAX = "update <index> <task> by <deadline>";
    
    private static final String MESSAGE_UPDATE_SUCCESS = "Item successfully updated!";
    
    private static CommandDefinition commandDefinition =
            new CommandDefinition(NAME, DESCRIPTION, COMMAND_SYNTAX); 

    public static CommandDefinition getCommandDefinition() {
        return commandDefinition;
    }

    @Override
    public float inputConfidence(String input) {
        // TODO
        return (input.toLowerCase().startsWith("update")) ? 1 : 0;
    }

    @Override
    public void process(String args) {
        // TODO: Example of last minute work
        
        
    }
}

@@ -1263,24 +1263,786 @@
 1 : 0;%0A    %7D
+%0A    %0A    /**%0A     * Get the token definitions for use with %3Ccode%3Etokenizer%3C/code%3E.%3Cbr%3E%0A     * This method exists primarily because Java does not support HashMap%0A     * literals...%0A     * %0A     * @return tokenDefinitions%0A     */%0A    private static Map%3CString, String%5B%5D%3E getTokenDefinitions() %7B%0A        Map%3CString, String%5B%5D%3E tokenDefinitions = new HashMap%3CString, String%5B%5D%3E();%0A        tokenDefinitions.put(%22default%22, new String%5B%5D %7B%22update%22%7D);%0A        tokenDefinitions.put(%22name%22, new String%5B%5D %7B%22name%22%7D);%0A        tokenDefinitions.put(%22time%22, new String%5B%5D %7B %22at%22, %22by%22, %22on%22, %22before%22, %22time%22 %7D);%0A        tokenDefinitions.put(%22timeFrom%22, new String%5B%5D %7B %22from%22 %7D);%0A        tokenDefinitions.put(%22timeTo%22, new String%5B%5D %7B %22to%22 %7D);%0A        return tokenDefinitions;%0A    %7D
 %0A%0A    @Overr

Add tokenDefinitions