<commit_before>package ca.ualberta.team7project.controllers;

import java.util.LinkedList;

import android.app.Activity;
import ca.ualberta.team7project.models.ThreadListModel;
import ca.ualberta.team7project.models.ThreadModel;
import ca.ualberta.team7project.models.UserModel;
import ca.ualberta.team7project.views.ThreadListView;


public class ThreadListController extends Activity
{

	private ThreadListModel listModel;
	private ThreadListView listView;
	private static Activity activity;
	
	public ThreadListController(Activity activity){
		
		ThreadListController.activity = activity;
		
		/* ThreadListModel needs to be populated. Either pull from elastic search or cache */
		debugPopulate(); //temporary debug populate

		this.listModel = new ThreadListModel();
		this.listView = new ThreadListView(this.listModel, activity);

	}
	
	/*
	 * NOTE THIS IS JUST A DEBUG METHOD FOR TESTING LISTVIEW RIGHT NOW
	 * Once cache and network is up, this is not necessary
	 */
	public void debugPopulate()
	{
		UserModel user = new UserModel("<NAME>");
		ThreadModel thread = new ThreadModel("Caught Snorelax", user, null);
		ThreadModel threadOne = new ThreadModel("Caught Charmander", user, null);
		ThreadModel threadTwo = new ThreadModel("Caught Pidgeo", user, null);
		
		LinkedList<ThreadModel> threads = new LinkedList<ThreadModel>();
		threads.add(thread);
		threads.add(threadOne);
		threads.add(threadTwo);
		//this.listModel.setTopics(threads);
	}
	
	/**
	 * If a network connection exists, pull the latest and greatest from ElasticSearch
	 * <p>
	 * ThreadListModel is populated with the results from ElasticSearch
	 */
	public void refreshThreads()
	{
		// TODO call the persistence and network classes here
	}

	
	public ThreadListModel getListModel()
	{
	
		return listModel;
	}

	
	public void setListModel(ThreadListModel threads)
	{<commit_msg>Fixed a mistake in debug method<commit_after>package ca.ualberta.team7project.controllers;

import java.util.LinkedList;

import android.app.Activity;
import ca.ualberta.team7project.models.ThreadListModel;
import ca.ualberta.team7project.models.ThreadModel;
import ca.ualberta.team7project.models.UserModel;
import ca.ualberta.team7project.views.ThreadListView;


public class ThreadListController extends Activity
{

	private ThreadListModel listModel;
	private ThreadListView listView;
	private static Activity activity;
	
	public ThreadListController(Activity activity){
		
		ThreadListController.activity = activity;
		
		/* ThreadListModel needs to be populated. Either pull from elastic search or cache */
		debugPopulate(); //temporary debug populate

		this.listModel = new ThreadListModel();
		this.listView = new ThreadListView(this.listModel, activity);

	}
	
	/*
	 * NOTE THIS IS JUST A DEBUG METHOD FOR TESTING LISTVIEW RIGHT NOW
	 * Once cache and network is up, this is not necessary
	 */
	public void debugPopulate()
	{
		UserModel user = new UserModel("<NAME>");
		ThreadModel thread = new ThreadModel("Caught Snorelax", user, null);
		ThreadModel threadOne = new ThreadModel("Caught Charmander", user, null);
		ThreadModel threadTwo = new ThreadModel("Caught Pidgeo", user, null);
		
		LinkedList<ThreadModel> threads = new LinkedList<ThreadModel>();
		threads.add(thread);
		threads.add(threadOne);
		threads.add(threadTwo);
		
		ThreadListModel newListModel = new ThreadListModel();
		newListModel.setTopics(threads);
		setListModel(newListModel);
	}
	
	/**
	 * If a network connection exists, pull the latest and greatest from ElasticSearch
	 * <p>
	 * ThreadListModel is populated with the results from ElasticSearch
	 */
	public void refreshThreads()
	{
		// TODO call the persistence and network classes here
	}

	
	public ThreadListModel getListModel()
	{
	
		return listModel;
	}

	
	public void setListModel(ThreadListModel threads)
	{
{'fraction_non_alphanumeric': 0.08527334554015172, 'fraction_numerical': 0.0026157467957101752, 'mean_word_length': 4.77643504531722, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3959642', 'n_tokens_mistral': 1187, 'n_tokens_neox': 1059, 'n_words': 322}