<commit_before>package sg.edu.cs2103aug2015_w13_2j;

/**
This class implements methods from LogicInterface
@author <NAME>  

TODO: Should we include a HashMap besides the ArrayList of Tasks
so as to store the task names as keys?
 */

import java.util.*;

public class Logic implements LogicInterface{
    private ArrayList<Task> tasks;
    private ArrayList<Task> events;//TBC if needed
    private ArrayList<Task> deadlines;//TBC if needed
    private ArrayList<Task> floating;//TBC if needed
    private ArrayList<Task> userView;//to store the user's latest requested list if any
                                     //eg. user filter(completed) all completed tasks will be store
                                     //here in case user wants to perform further request 
    
    public Logic(){
        tasks = new ArrayList<Task>();	
        events = new ArrayList<Task>();	
        deadlines = new ArrayList<Task>();	
        floating = new ArrayList<Task>();	
        userView = new ArrayList<Task>();
    }
    
    public void addTask(Task task){
    	tasks.add(task);
    }
    
    public Task getTask(int index){
    	return tasks.get(index);
    }
    
    public void deleteTask(Task task){
    	tasks.remove(task);
    }
    
    public void archiveTask(Task task){
    	
    }
    
    
    public void sortByDeadLine(){
    	
    }
    
    public ArrayList<Task> getAllTask(){
    	return tasks;
    }
    
    public void echo(String s){
    	FunDUE.sFormatter.passThrough(s);
    }
    
   
    public Task findTaskByName(String name){
    	//for the case of only one task with the name first
    	Task result = new Task();
    	for(int i = 0; i < tasks.size(); i++){
    		if(tasks.get(i).getName().equals(name)){
    			result = tasks.get(i);
    			break; //for now, only output the first occurence
    		}
    	}
    	
       return result;
    }
}
<commit_msg>Edited addTask() to add into one of the 3 arrayLists according to type<commit_after>package sg.edu.cs2103aug2015_w13_2j;

/**
This class implements methods from LogicInterface
@author <NAME>  

TODO: Should we include a HashMap besides the ArrayList of Tasks
so as to store the task names as keys?
 */

import java.util.*;

public class Logic implements LogicInterface{
    private ArrayList<Task> tasks;
    private ArrayList<Task> events;//TBC if needed
    private ArrayList<Task> deadlines;//TBC if needed
    private ArrayList<Task> floats;//TBC if needed
    private ArrayList<Task> userView;//to store the user's latest requested list if any
                                     //eg. user filter(completed) all completed tasks will be store
                                     //here in case user wants to perform further request 
   /**
    * Constructor for the Logic component
    * 
    */
    public Logic(){
        tasks = new ArrayList<Task>();	
        events = new ArrayList<Task>();	
        deadlines = new ArrayList<Task>();	
        floats = new ArrayList<Task>();	
        userView = new ArrayList<Task>();
    }
    
    /**
     * Add a new task
     * @param task
     *            the new task to be added
     * 
     */
    public void addTask(Task task){
    	tasks.add(task);
    	
    	if(task.getType().equals("EVENT")){
    		events.add(task);
    	} else if (task.getType().equals("DUE")){
    		deadlines.add(task);
    	} else {
    		floats.add(task);
    	}
    }
    
    public Task getTask(int index){
    	return tasks.get(index);
    }
    
    public void deleteTask(Task task){
    	tasks.remove(task);
    }
    
    public void archiveTask(Task task){
    	
    }
    
    
    public void sortByDeadLine(){
    	
    }
    
    public ArrayList<Task> getAllTask(){
    	return tasks;
    }
    
    public void echo(String s){
    	FunDUE.sFormatter.passThrough(s);
    }
    
   
    public Task findTaskByName(String name){
    	//for the case of only one task with the name first
    	Task result = new Task();
    	for(int i = 0; i < tasks.size(); i++){
    		if(tasks.get(i).getName().equals(name)){
    			result = tasks.get(i);
    			break; //for now, only output the first occurence
    		}
    	}
    	
       return result;
    }
}

{'fraction_non_alphanumeric': 0.09658828953434763, 'fraction_numerical': 0.005763024435223606, 'mean_word_length': 1.8697089947089947, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '922098', 'n_tokens_mistral': 1353, 'n_tokens_neox': 1237, 'n_words': 381}