<commit_before>// Copyright 2015 <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package ca.ualberta.trinkettrader;

import android.app.Activity;

import java.util.ArrayList;
import java.util.Observer;

import ca.ualberta.trinkettrader.Friends.Friend;
import ca.ualberta.trinkettrader.Inventory.Inventory;
import ca.ualberta.trinkettrader.Inventory.Trinket.Trinket;
import ca.ualberta.trinkettrader.Trades.Trade;

/**
 * Singleton utility class responsible for handling the clicking of friends in a user's friend's list,
 * trinkets in a user's inventory, and trades in the user's active and past trade lists.
 * <p/>
 * Each time a friend, trinket, or trade is clicked in a list, this class will be used in the
 * <b>onItemClick</b> method of the respective controller to set the object which was clicked.
 * <p/>
 * For more information, please see the respective controllers:
 * for clicked friends - FriendsListController
 * for clicked trinkets - InventoryController
 * for clicked trades - ActiveTradesController , PastTradesController
 */
public class ApplicationState implements ca.ualberta.trinkettrader.Observable {

    private static ApplicationState ourInstance = new ApplicationState();
    private ArrayList<Observer> observers;
    private Trinket clickedTrinket;
    private Friend clickedFriend;
    private Trade clickedTrade;
    private Boolean inCounterTrade = false;
    private Inventory friendsTradeTrinkets = new Inventory();
    private Inventory yourTradeTrinkets = new Inventory();
    private Activity activity;



    private ApplicationState() {
    }

    /**
     * Returns the instance of the singleton
     *
     * @return ApplicationState
     */
    public static ApplicationState getInstance() {
        return ourInstance;
    }

    /**
     * Returns the friend most recently clicked on from the Friends List ListView.
     *
     * @return Friend
     */
    public Friend getClickedFriend() {
        return this.clickedFriend;
    }

    /**
     * Sets the friend most recently clicked on from the Friends List ListView.
     */
    public void setClickedFriend(Friend clickedFriend) {
        this.clickedFriend = clickedFriend;
    }

    /**
     * Returns the trinket most recently clicked on from the Inventory ListView.
     *
     * @return Trinket
     */
    public Trinket getClickedTrinket() {
        return this.clickedTrinket;
    }

    /**
     * Sets the trinket most recently clicked on from the Inventory ListView.
     */
    public void setClickedTrinket(Trinket clickedTrinket) {
        this.clickedTrinket = clickedTrinket;
    }


    /**
     * Gets the Inventory (list of Trinkets) that the user wants from the friend.
     *
     * @return the Inventory (list of Trinkets) representing what the user wants from the friend
     */
    public Inventory getFriendsTradeTrinkets() {
        return friendsTradeTrinkets;
    }


    /**
     * Sets the Inventory (list of Trinkets) that the user wants from the friend.
     */
    public void setFriendsTradeTrinkets(Inventory friendsTradeTrinkets) {
        this.friendsTradeTrinkets = friendsTradeTrinkets;
    }


    /**
     * Gets the Inventory (list of Trinkets) that the user wants to give to the friend.
     *
     * @return the Inventory (list of Trinkets) representing what the user wants to give to the friend
     */
    public Inventory getYourTradeTrinkets() {
        return yourTradeTrinkets;
    }

    /**
     * Sets the Inventory (list of Trinkets) that the user wants to give to the friend.
     */
    public void setYourTradeTrinkets(Inventory yourTradeTrinkets) {
        this.yourTradeTrinkets = yourTradeTrinkets;
    }

    /**
     * Returns the trade most recently clicked on from the Active Trades ListView (currentTradesListView)
     * or the Past Trades ListView (pastTradesListView).
     *
     * @return Trade returns clicked trade
     */
    public Trade getClickedTrade() {
        return this.clickedTrade;
    }

    /**
     * Sets the trinket most recently clicked on from the Active Trades ListView (currentTradesListView)
     * or the Past Trades ListView (pastTradesListView). Once clicked, a trade will have been viewed
     * by the user and will not be new anymore.  This method calls 'setNotNewOfferedTrade' which removes
     * the <b>NEW!</b> status of of the trade, which changes how the trade will be displayed in the
     * Current Trades list.
     *
     * @param clickedTrade trade that was clicked
     */
    public void setClickedTrade(Trade clickedTrade) {
        clickedTrade.setNotNewOfferedTrade();
        this.clickedTrade = clickedTrade;
    }

    /**
     *
     *
     * @return Boolean
     */
    public Boolean getInCounterTrade() {
        return inCounterTrade;
    }

    /**
     *
     *
     * @param inCounterTrade
     */
    public void setInCounterTrade(Boolean inCounterTrade) {<commit_msg>added meaningless line to try to get ApplicationState to change<commit_after>// Copyright 2015 <NAME>, <NAME>, <NAME>, <NAME>, <NAME>, <NAME>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package ca.ualberta.trinkettrader;

import android.app.Activity;

import java.util.ArrayList;
import java.util.Observer;

import ca.ualberta.trinkettrader.Friends.Friend;
import ca.ualberta.trinkettrader.Inventory.Inventory;
import ca.ualberta.trinkettrader.Inventory.Trinket.Trinket;
import ca.ualberta.trinkettrader.Trades.Trade;

/**
 * Singleton utility class responsible for handling the clicking of friends in a user's friend's list,
 * trinkets in a user's inventory, and trades in the user's active and past trade lists.
 * <p/>
 * Each time a friend, trinket, or trade is clicked in a list, this class will be used in the
 * <b>onItemClick</b> method of the respective controller to set the object which was clicked.
 * <p/>
 * For more information, please see the respective controllers:
 * for clicked friends - FriendsListController
 * for clicked trinkets - InventoryController
 * for clicked trades - ActiveTradesController , PastTradesController
 */
public class ApplicationState implements ca.ualberta.trinkettrader.Observable {

    private static ApplicationState ourInstance = new ApplicationState();
    private ArrayList<Observer> observers;
    private Trinket clickedTrinket;
    private Friend clickedFriend;
    private Trade clickedTrade;
    private Boolean inCounterTrade = false;
    private Inventory friendsTradeTrinkets = new Inventory();
    private Inventory yourTradeTrinkets = new Inventory();
    private Activity activity;



    private ApplicationState() {
    }

    /**
     * Returns the instance of the singleton
     *
     * @return ApplicationState
     */
    public static ApplicationState getInstance() {
        return ourInstance;
    }

    /**
     * Returns the friend most recently clicked on from the Friends List ListView.
     *
     * @return Friend
     */
    public Friend getClickedFriend() {
        return this.clickedFriend;
    }

    /**
     * Sets the friend most recently clicked on from the Friends List ListView.
     */
    public void setClickedFriend(Friend clickedFriend) {
        this.clickedFriend = clickedFriend;
    }

    /**
     * Returns the trinket most recently clicked on from the Inventory ListView.
     *
     * @return Trinket
     */
    public Trinket getClickedTrinket() {
        return this.clickedTrinket;
    }

    /**
     * Sets the trinket most recently clicked on from the Inventory ListView.
     */
    public void setClickedTrinket(Trinket clickedTrinket) {
        this.clickedTrinket = clickedTrinket;
    }


    /**
     * Gets the Inventory (list of Trinkets) that the user wants from the friend.
     *
     * @return the Inventory (list of Trinkets) representing what the user wants from the friend
     */
    public Inventory getFriendsTradeTrinkets() {
        return friendsTradeTrinkets;
    }


    /**
     * Sets the Inventory (list of Trinkets) that the user wants from the friend.
     */
    public void setFriendsTradeTrinkets(Inventory friendsTradeTrinkets) {
        this.friendsTradeTrinkets = friendsTradeTrinkets;
    }


    /**
     * Gets the Inventory (list of Trinkets) that the user wants to give to the friend.
     *
     * @return the Inventory (list of Trinkets) representing what the user wants to give to the friend
     */
    public Inventory getYourTradeTrinkets() {
        return yourTradeTrinkets;
    }

    /**
     * Sets the Inventory (list of Trinkets) that the user wants to give to the friend.
     */
    public void setYourTradeTrinkets(Inventory yourTradeTrinkets) {
        this.yourTradeTrinkets = yourTradeTrinkets;
    }

    /**
     * Returns the trade most recently clicked on from the Active Trades ListView (currentTradesListView)
     * or the Past Trades ListView (pastTradesListView).
     *
     * @return Trade returns clicked trade
     */
    public Trade getClickedTrade() {
        return this.clickedTrade;
    }

    /**
     * Sets the trinket most recently clicked on from the Active Trades ListView (currentTradesListView)
     * or the Past Trades ListView (pastTradesListView). Once clicked, a trade will have been viewed
     * by the user and will not be new anymore.  This method calls 'setNotNewOfferedTrade' which removes
     * the <b>NEW!</b> status of of the trade, which changes how the trade will be displayed in the
     * Current Trades list.
     *
     * @param clickedTrade trade that was clicked
     */
    public void setClickedTrade(Trade clickedTrade) {
        clickedTrade.setNotNewOfferedTrade();
        this.clickedTrade = clickedTrade;
    }
    // TODO update -__-
    /**
     *
     *
     * @return Boolean
     */
    public Boolean getInCounterTrade() {
        return inCounterTrade;
    }

    /**
     *
     *
     * @param inCounterTrade
     */
    public void setInCounterTrade(Boolean inCounterTrade) {
{'fraction_non_alphanumeric': 0.07450587485199016, 'fraction_numerical': 0.0014573276254668003, 'mean_word_length': 2.9681966028189373, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6987244', 'n_tokens_mistral': 3099, 'n_tokens_neox': 2986, 'n_words': 1093}