<commit_before>/*

Copyright 2014 Profesores y alumnos de la asignatura Informtica Mvil de la EPI de Gijn

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 es.uniovi.imovil.fcrtrainer;

import android.support.v4.app.Fragment;

/**
 * Clase factora para crear los diferentes fragmentos de los ejercicios. Cada
 * alumno debera insertar la llamada a su fragmento.newInstance() donde le
 * corresponda.
 * 
 */
final public class FragmentFactory {

	/**
	 * Crea el fragmento de un ejercicio a partir de un ndice. Este ndice
	 * coincide con el ndice de la opcin correspondiente en el Drawer.
	 * 
	 * @param ndice
	 *            del ejercicio en el Drawer.
	 * @return el fragmento del ejercicio.
	 */
	static Fragment createExercise(int resIndex) {
		switch (resIndex) {
		case R.string.highscores:
			return HighscoresFragment.newInstance();
		case R.string.binary:
			// TODO: return BinaryExerciseFragment.newInstance();
		case R.string.hexadecimal:
			// TODO: return HexadecimalExerciseFragment.newInstance();
		case R.string.sign_and_magnitude:
			// TODO: return SignedMagnitudeExerciseFragment.newInstance();
		case R.string.interpretation:
			// TODO: 
			return InterpretationExerciseFragment.newInstance();
		case R.string.floating_point:
			// TODO: return FloatingPointExerciseFragment.newInstance();
		case R.string.logic_gate:
			// TODO: return LogicGateExerciseFragment.newInstance();
		case R.string.logic_operation:
			// TODO: 
			return LogicOperationExerciseFragment.newInstance();
		case R.string.network_address:
			// TODO: return NetworAddressExerciseFragment.newInstance();
		case R.string.cidr:
			// TODO: return CidrExerciseFragment.newInstance();
		case R.string.host_count:
			// TODO: return HostCountExerciseFragment.newInstance();
		case R.string.network_mask:
			// TODO: return NetworkMaskExerciseFragment.newInstance();
		case R.string.network_layer:
			return NetworkLayerExerciseFragment.newInstance();
		case R.string.protocol:
			return ProtocolExerciseFragment.newInstance();

			//return DummyExerciseFragment.newInstance();

		default:
			throw new IllegalStateException();
		}
	}<commit_msg>Copio mi FragmentFactory actual<commit_after>/*

Copyright 2014 Profesores y alumnos de la asignatura Informtica Mvil de la EPI de Gijn

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 es.uniovi.imovil.fcrtrainer;

import android.support.v4.app.Fragment;

/**
 * Clase factora para crear los diferentes fragmentos de los ejercicios. Cada
 * alumno debera insertar la llamada a su fragmento.newInstance() donde le
 * corresponda.
 * 
 */
final public class FragmentFactory {

	/**
	 * Crea el fragmento de un ejercicio a partir de un ndice. Este ndice
	 * coincide con el ndice de la opcin correspondiente en el Drawer.
	 * 
	 * @param ndice
	 *            del ejercicio en el Drawer.
	 * @return el fragmento del ejercicio.
	 */
	static Fragment createExercise(int resIndex) {
		switch (resIndex) {
		case R.string.highscores:
			return HighscoresFragment.newInstance();
		case R.string.interpretation:
			return InterpretationExerciseFragment.newInstance();
		case R.string.logic_operation:
			return LogicOperationExerciseFragment.newInstance();
		case R.string.network_layer:
			return NetworkLayerExerciseFragment.newInstance();
		case R.string.protocol:
			return ProtocolExerciseFragment.newInstance();
		case R.string.hexadecimal:
			return HexadecimalExerciseFragment.newInstance();
		case R.string.binary:
			// TODO: return BinaryExerciseFragment.newInstance();
		case R.string.sign_and_magnitude:
			// TODO: return SignedMagnitudeExerciseFragment.newInstance();
		case R.string.floating_point:
			// TODO: return FloatingPointExerciseFragment.newInstance();
		case R.string.logic_gate:
			// TODO: return LogicGateExerciseFragment.newInstance();
		case R.string.network_address:
			// TODO: return NetworAddressExerciseFragment.newInstance();
		case R.string.cidr:
			// TODO: return CidrExerciseFragment.newInstance();
		case R.string.host_count:
			// TODO: return HostCountExerciseFragment.newInstance();
		case R.string.network_mask:
			// TODO: return NetworkMaskExerciseFragment.newInstance();

			return DummyExerciseFragment.newInstance();

		default:
			throw new IllegalStateException();
		}
	}
{'fraction_non_alphanumeric': 0.0824249378466246, 'fraction_numerical': 0.0034423407917383822, 'mean_word_length': 4.240480961923848, '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': '4327930', 'n_tokens_mistral': 1663, 'n_tokens_neox': 1490, 'n_words': 478}