<commit_before>package monitoring.impl;

import java.util.Arrays;

import monitoring.impl.monitors.*;
import monitoring.intf.Monitor;
import structure.impl.*;
import structure.intf.QEA;

/**
 * This class should be used to construct Monitors from QEA
 * 
 * The general idea is that the structural properties of the QEA are used to
 * select an appropriate Monitor implementation
 * 
 * @author <NAME>
 * @author <NAME>
 */

public class MonitorFactory {
	
	/**
	 * Constructs a Monitor given a QEA
	 * 
	 * @param qea
	 *            The QEA property
	 * @return A monitor for the QEA property
	 */
	public static Monitor create(QEA qea) {
		
		if(qea instanceof SimpleDetQEA){
			if(qea.getLambda().length==0) return new IncrementalPropositionalQEAMonitor((SimpleDetQEA) qea);
			else return new IncrementalSimpleDetQEAMonitor((SimpleDetQEA) qea);
			
		} else if (qea instanceof SimpleNonDetQEA){
			if(qea.getLambda().length==0) return null; // TODO: New monitor to be created
			else return new IncrementalSimpleNonDetQEAMonitor((SimpleNonDetQEA) qea);
		} else if (!qea.isDeterministic() && !qea.usesFreeVariables()
				&& qea.getLambda().length == 0) {<commit_msg>*Monitors for new cases created<commit_after>package monitoring.impl;

import monitoring.impl.monitors.IncrementalNSPropositionalNonDetQEAMonitor;
import monitoring.impl.monitors.IncrementalNSPropositionalQEAMonitor;
import monitoring.impl.monitors.IncrementalNonSimpleDetQEAMonitor;
import monitoring.impl.monitors.IncrementalNonSimpleNonDetQEAMonitor;
import monitoring.impl.monitors.IncrementalPropositionalNonDetQEAMonitor;
import monitoring.impl.monitors.IncrementalPropositionalQEAMonitor;
import monitoring.impl.monitors.IncrementalSimpleDetQEAMonitor;
import monitoring.impl.monitors.IncrementalSimpleNonDetQEAMonitor;
import monitoring.intf.Monitor;
import structure.impl.NonSimpleDetQEA;
import structure.impl.NonSimpleNonDetQEA;
import structure.impl.SimpleDetQEA;
import structure.impl.SimpleNonDetQEA;
import structure.intf.QEA;

/**
 * This class should be used to construct Monitors from QEA
 * 
 * The general idea is that the structural properties of the QEA are used to
 * select an appropriate Monitor implementation
 * 
 * @author <NAME>
 * @author <NAME>
 */

public class MonitorFactory {

	/**
	 * Constructs a Monitor given a QEA
	 * 
	 * @param qea
	 *            The QEA property
	 * @return A monitor for the QEA property
	 */
	public static Monitor create(QEA qea) {

		if (qea instanceof SimpleDetQEA) {
			if (qea.getLambda().length == 0)
				return new IncrementalPropositionalQEAMonitor(
						(SimpleDetQEA) qea);
			else
				return new IncrementalSimpleDetQEAMonitor((SimpleDetQEA) qea);

		} else if (qea instanceof SimpleNonDetQEA) {
			if (qea.getLambda().length == 0)
				return new IncrementalPropositionalNonDetQEAMonitor(
						(SimpleNonDetQEA) qea);
			else
				return new IncrementalSimpleNonDetQEAMonitor(
						(SimpleNonDetQEA) qea);
		} else if (qea instanceof NonSimpleDetQEA) {
			if (qea.getLambda().length == 0) {
				return new IncrementalNSPropositionalQEAMonitor(
						(NonSimpleDetQEA) qea);
			} else {
				return new IncrementalNonSimpleDetQEAMonitor(
						(NonSimpleDetQEA) qea);
			}
		} else if (qea instanceof NonSimpleNonDetQEA) {
			if (qea.getLambda().length == 0) {
				return new IncrementalNSPropositionalNonDetQEAMonitor(
						(NonSimpleNonDetQEA) qea);
			} else {
				return new IncrementalNonSimpleNonDetQEAMonitor(
						(NonSimpleNonDetQEA) qea);
			}

		} else if (!qea.isDeterministic() && !qea.usesFreeVariables()
				&& qea.getLambda().length == 0) {
{'fraction_non_alphanumeric': 0.09108580949736185, 'fraction_numerical': 0.0022216051096917524, 'mean_word_length': 4.4658573596358115, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6881217', 'n_tokens_mistral': 1284, 'n_tokens_neox': 1113, 'n_words': 282}