<commit_before>/*
 * Copyright 2016 CMPUT301F16T10
 *
 *   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.cs.drivr;

import java.util.Observable;

/**
 * A (singleton) model class for providing access to application data.
 */
public class UserManager extends Observable implements IUserManager {

    /**
     * The current user.
     */
    private User user;

    /**
     * The current user mode.
     */
    private UserMode userMode;

    /**
     * The user's requests.
     */
    private RequestsList requestsList;

    /**
     * A singleton instance.
     */
    private static final UserManager instance = new UserManager();

    /**
     * Get access to the singleton instance.
     * @return The singleton instance.
     */
    public static UserManager getInstance() {
        return instance;
    }

    /**
     * Instantiate a new user manager.
     */
    protected UserManager() {
        user = new User();
        userMode = UserMode.RIDER;
        requestsList = new RequestsList();
    }

    /**
     * Get the current user.
     * @return The current user.
     */
    @Override
    public User getUser() {
        return user;
    }

    /**
     * Set the current user.
     * @param user The current user.
     */
    @Override
    public void setUser(User user) {
        this.user = user;
    }

    /**
     * Get the list of requests.
     * @return The requests list.
     */
    @Override
    public RequestsList getRequestsList() {
        return requestsList;
    }

    /**
     * Set the list of requests.
     * @param requestsList The requests list.
     */
    @Override
    public void setRequestsList(RequestsList requestsList) {
        this.requestsList = requestsList;
    }

    /**
     * Get the current user mode.
     * @return The current user mode.
     */
    @Override
    public UserMode getUserMode() {
        return userMode;
    }

    /**
     * Set the user mode.
     * @param userMode The user mode.
     */
    @Override
    public void setUserMode(UserMode userMode) {
        this.userMode = userMode;
    }

    /**
     * Notifies all observers of this object that the object has changed. This forces the object
     * into a changed state so all observers will see that the object has changed on every call to
     * this method.
     */
    @Override
    public void notifyObservers() {
        setChanged();
        super.notifyObservers();
    }
}<commit_msg>Added a todo not for updating model with elasticsearch<commit_after>/*
 * Copyright 2016 CMPUT301F16T10
 *
 *   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.cs.drivr;

import java.util.Observable;

/**
 * A (singleton) model class for providing access to application data.
 */
public class UserManager extends Observable implements IUserManager {

    /**
     * The current user.
     */
    private User user;

    /**
     * The current user mode.
     */
    private UserMode userMode;

    /**
     * The user's requests.
     */
    private RequestsList requestsList;

    /**
     * A singleton instance.
     */
    private static final UserManager instance = new UserManager();

    /**
     * Get access to the singleton instance.
     * @return The singleton instance.
     */
    public static UserManager getInstance() {
        return instance;
    }

    /**
     * Instantiate a new user manager.
     */
    protected UserManager() {
        user = new User();
        userMode = UserMode.RIDER;
        requestsList = new RequestsList();
    }

    /**
     * Get the current user.
     * @return The current user.
     */
    @Override
    public User getUser() {
        return user;
    }

    /**
     * Set the current user.
     * @param user The current user.
     */
    @Override
    public void setUser(User user) {
        this.user = user;
    }

    /**
     * Get the list of requests.
     * @return The requests list.
     */
    @Override
    public RequestsList getRequestsList() {
        return requestsList;
    }

    /**
     * Set the list of requests.
     * @param requestsList The requests list.
     */
    @Override
    public void setRequestsList(RequestsList requestsList) {
        this.requestsList = requestsList;
    }

    /**
     * Get the current user mode.
     * @return The current user mode.
     */
    @Override
    public UserMode getUserMode() {
        return userMode;
    }

    /**
     * Set the user mode.
     * @param userMode The user mode.
     */
    @Override
    public void setUserMode(UserMode userMode) {
        this.userMode = userMode;
    }

    /**
     * Notifies all observers of this object that the object has changed. This forces the object
     * into a changed state so all observers will see that the object has changed on every call to
     * this method.
     */
    @Override
    public void notifyObservers() {
        setChanged();
        // TODO: update everything with Elasticsearch
        super.notifyObservers();
    }
}
{'fraction_non_alphanumeric': 0.08610147083126755, 'fraction_numerical': 0.00495785820525533, 'mean_word_length': 2.124419204956118, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7585948', 'n_tokens_mistral': 1666, 'n_tokens_neox': 1621, 'n_words': 609}