<commit_before>package com.example.cmput401.classdiscuss;

import java.util.ArrayList;
import java.util.HashMap;

/*
 * copyright 2015 <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
 */
public class MyChannels {
    String ACTIVE = "active";
    String UNACTIVE = "unActive";
    private static final MyChannels MyChannelsInstance = new MyChannels();

    public ArrayList<String>displayMessage;
    private HashMap<String, String> subscribedChannelList;

    private MyChannels() {
        this.displayMessage = new ArrayList<String>();
        this.subscribedChannelList = new HashMap<String, String>();
    }

    public static MyChannels getInstance(){
        return MyChannelsInstance;
    }

    public void addChannel(String item){
        if(!this.subscribedChannelList.containsKey(item)){
            this.subscribedChannelList.put(item, ACTIVE);
            updateChannelsToParse();
        }
    }

    public boolean isChannelActive(String item){
        if(this.subscribedChannelList.containsKey(item)){
            if(this.subscribedChannelList.get(item).contains(ACTIVE)){
                return true;
            }
        }
        return false;
    }

    private void updateChannelsToParse(){
        String HashMapStrings = MapUtil.mapToString(subscribedChannelList);
        ParseDatabase.getInstance().UpdateChannelsToParse(HashMapStrings);
    }

    public void initiateLocalChannelsList(String items){
        //the string has to be hashmap compatible
        this.subscribedChannelList.clear();
        this.subscribedChannelList = MapUtil.stringToMap(items);
    }

    public void unSubscribeToChannels(String Channel){
        if(this.subscribedChannelList.containsKey(Channel)){
            this.subscribedChannelList.put(Channel, UNACTIVE);
            updateChannelsToParse();
        }
    }

    public void subscribeToChannels(String Channel){
        if(this.subscribedChannelList.containsKey(Channel)){
            this.subscribedChannelList.put(Channel, ACTIVE);
            updateChannelsToParse();
        }
    }

    public void deleteChannel(String item){
        if(this.subscribedChannelList.containsKey(item)){
            this.subscribedChannelList.remove(item);
            updateChannelsToParse();
        }
    }

    public boolean ifContains(String item){
        return this.subscribedChannelList.containsKey(item);
    }

    public ArrayList getSubscribedList(){
        ArrayList<String> list = new ArrayList<String>(subscribedChannelList.keySet());
        return list;
    }
}<commit_msg>Changed MapUtil to util<commit_after>package com.example.cmput401.classdiscuss;

import java.util.ArrayList;
import java.util.HashMap;

/*
 * copyright 2015 <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
 */
public class MyChannels {
    String ACTIVE = "active";
    String UNACTIVE = "unActive";
    private static final MyChannels MyChannelsInstance = new MyChannels();

    public ArrayList<String>displayMessage;
    private HashMap<String, String> subscribedChannelList;

    private MyChannels() {
        this.displayMessage = new ArrayList<String>();
        this.subscribedChannelList = new HashMap<String, String>();
    }

    public static MyChannels getInstance(){
        return MyChannelsInstance;
    }

    public void addChannel(String item){
        if(!this.subscribedChannelList.containsKey(item)){
            this.subscribedChannelList.put(item, ACTIVE);
            updateChannelsToParse();
        }
    }

    public boolean isChannelActive(String item){
        if(this.subscribedChannelList.containsKey(item)){
            if(this.subscribedChannelList.get(item).contains(ACTIVE)){
                return true;
            }
        }
        return false;
    }

    private void updateChannelsToParse(){
        String HashMapStrings = util.mapToString(subscribedChannelList);
        ParseDatabase.getInstance().UpdateChannelsToParse(HashMapStrings);
    }

    public void initiateLocalChannelsList(String items){
        //the string has to be hashmap compatible
        this.subscribedChannelList.clear();
        this.subscribedChannelList = util.stringToMap(items);
    }

    public void unSubscribeToChannels(String Channel){
        if(this.subscribedChannelList.containsKey(Channel)){
            this.subscribedChannelList.put(Channel, UNACTIVE);
            updateChannelsToParse();
        }
    }

    public void subscribeToChannels(String Channel){
        if(this.subscribedChannelList.containsKey(Channel)){
            this.subscribedChannelList.put(Channel, ACTIVE);
            updateChannelsToParse();
        }
    }

    public void deleteChannel(String item){
        if(this.subscribedChannelList.containsKey(item)){
            this.subscribedChannelList.remove(item);
            updateChannelsToParse();
        }
    }

    public boolean ifContains(String item){
        return this.subscribedChannelList.containsKey(item);
    }

    public ArrayList getSubscribedList(){
        ArrayList<String> list = new ArrayList<String>(subscribedChannelList.keySet());
        return list;
    }
}
{'fraction_non_alphanumeric': 0.09602518693427785, 'fraction_numerical': 0.0027548209366391185, 'mean_word_length': 2.9773082942097027, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 25, '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': '6349291', 'n_tokens_mistral': 1357, 'n_tokens_neox': 1315, 'n_words': 257}