<commit_before>/*******************************************************************************
 * Copyright (c) 2013 See AUTHORS file.
 * 
 * This file is part of SleepFighter.
 * 
 * SleepFighter is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * SleepFighter is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with SleepFighter. If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/
package se.chalmers.dat255.sleepfighter.factory;

import se.chalmers.dat255.sleepfighter.model.Alarm;

/**
 * FromPresetAlarmFactory creates an Alarm from a preset alarm object.
 *
 * @author Centril<<EMAIL>> / <NAME>.
 * @version 1.0
 * @since Oct 4, 2013
 */
public class FromPresetAlarmFactory implements AlarmFactory {
	private Alarm preset;

	/**
	 * Constructs a FromPresetAlarmFactory given a preset.
	 *
	 * @param preset the preset to use.
	 */
	public FromPresetAlarmFactory( Alarm preset ) {
		if ( !preset.isPresetAlarm() ) {
			throw new IllegalArgumentException( "Alarm provided is not a preset." );
		}

		this.preset = preset;
	}

	@Override
	public Alarm createAlarm() {
		return new Alarm( this.preset );
	}
}<commit_msg>Fixed getPreset() in FromPresetAlarmFactory<commit_after>/*******************************************************************************
 * Copyright (c) 2013 See AUTHORS file.
 * 
 * This file is part of SleepFighter.
 * 
 * SleepFighter is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * 
 * SleepFighter is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with SleepFighter. If not, see <http://www.gnu.org/licenses/>.
 ******************************************************************************/
package se.chalmers.dat255.sleepfighter.factory;

import se.chalmers.dat255.sleepfighter.model.Alarm;

/**
 * FromPresetAlarmFactory creates an Alarm from a preset alarm object.
 *
 * @author Centril<<EMAIL>> / <NAME>.
 * @version 1.0
 * @since Oct 4, 2013
 */
public class FromPresetAlarmFactory implements AlarmFactory {
	private Alarm preset;

	/**
	 * Constructs a FromPresetAlarmFactory given a preset.
	 *
	 * @param preset the preset to use.
	 */
	public FromPresetAlarmFactory( Alarm preset ) {
		if ( !preset.isPresetAlarm() ) {
			throw new IllegalArgumentException( "Alarm provided is not a preset." );
		}

		this.preset = preset;
	}

	@Override
	public Alarm createAlarm() {
		return new Alarm( this.preset );
	}

	/**
	 * Returns the preset if need be.
	 *
	 * @return the preset.
	 */
	public Alarm getPreset() {
		return this.preset;
	}
}
{'fraction_non_alphanumeric': 0.16999710396756443, 'fraction_numerical': 0.010425716768027803, 'mean_word_length': 4.109467455621302, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '1092963', 'n_tokens_mistral': 1026, 'n_tokens_neox': 930, 'n_words': 369}