<commit_before>package monitoring.impl;

import monitoring.intf.Monitor;
import structure.impl.Verdict;
import structure.intf.QEA;

/**
 * All incremental monitors implement the trace method using the step method.
 * 
 * 
 * @author <NAME>
 * @author <NAME>
 */
public abstract class IncrementalMonitor<Q extends QEA> extends Monitor<Q> {

	protected int bindingsInNonFinalStateCount;

	protected int bindingsInFinalStateCount;

	public IncrementalMonitor(Q q) {
		super(q);
	}

	@Override
	public Verdict trace(int[] eventNames, Object[][] args) {

		Verdict finalVerdict = null;

		for (int i = 0; i < eventNames.length; i++) {
			switch (args[i].length) {
			case 0:
				finalVerdict = step(eventNames[i]);
				break;
			case 1:
				finalVerdict = step(eventNames[i], args[i][0]);
				break;
			case 2:
				finalVerdict = step(eventNames[i], args[i][0], args[i][1]);
				break;
			case 3:
				finalVerdict = step(eventNames[i], args[i][0], args[i][1],
						args[i][2]);
				break;
			case 4:
				finalVerdict = step(eventNames[i], args[i][0], args[i][1],
						args[i][2], args[i][3]);
				break;
			case 5:
				finalVerdict = step(eventNames[i], args[i][0], args[i][1],
						args[i][2], args[i][3], args[i][4]);
				break;
			default:
				finalVerdict = step(eventNames[i], args[i]);
				break;
			}
			step(eventNames[i], args[i]);
		}
		return finalVerdict;
	}

	/**
	 * Determines if all bindings for the current monitor are in a final state
	 * 
	 * @return <code>true</code> if all bindings for the current monitor are in
	 *         a final state; <code>false</code> otherwise
	 */
	protected boolean allBindingsInFinalState() {
		if (bindingsInNonFinalStateCount == 0) {
			return true;
		}
		return false;
	}

	/**
	 * Determines if there is at least one binding in a final state for the
	 * current monitor
	 * 
	 * @return <code>true</code> if at least one binding is in final state;
	 *         <code>false</code> otherwise
	 */
	protected boolean existsOneBindingInFinalState() {<commit_msg>Extra 'step' method invokation removed<commit_after>package monitoring.impl;

import monitoring.intf.Monitor;
import structure.impl.Verdict;
import structure.intf.QEA;

/**
 * All incremental monitors implement the trace method using the step method.
 * 
 * 
 * @author <NAME>
 * @author <NAME>
 */
public abstract class IncrementalMonitor<Q extends QEA> extends Monitor<Q> {

	protected int bindingsInNonFinalStateCount;

	protected int bindingsInFinalStateCount;

	public IncrementalMonitor(Q q) {
		super(q);
	}

	@Override
	public Verdict trace(int[] eventNames, Object[][] args) {

		Verdict finalVerdict = null;

		for (int i = 0; i < eventNames.length; i++) {
			switch (args[i].length) {
			case 0:
				finalVerdict = step(eventNames[i]);
				break;
			case 1:
				finalVerdict = step(eventNames[i], args[i][0]);
				break;
			case 2:
				finalVerdict = step(eventNames[i], args[i][0], args[i][1]);
				break;
			case 3:
				finalVerdict = step(eventNames[i], args[i][0], args[i][1],
						args[i][2]);
				break;
			case 4:
				finalVerdict = step(eventNames[i], args[i][0], args[i][1],
						args[i][2], args[i][3]);
				break;
			case 5:
				finalVerdict = step(eventNames[i], args[i][0], args[i][1],
						args[i][2], args[i][3], args[i][4]);
				break;
			default:
				finalVerdict = step(eventNames[i], args[i]);
				break;
			}
		}
		return finalVerdict;
	}

	/**
	 * Determines if all bindings for the current monitor are in a final state
	 * 
	 * @return <code>true</code> if all bindings for the current monitor are in
	 *         a final state; <code>false</code> otherwise
	 */
	protected boolean allBindingsInFinalState() {
		if (bindingsInNonFinalStateCount == 0) {
			return true;
		}
		return false;
	}

	/**
	 * Determines if there is at least one binding in a final state for the
	 * current monitor
	 * 
	 * @return <code>true</code> if at least one binding is in final state;
	 *         <code>false</code> otherwise
	 */
	protected boolean existsOneBindingInFinalState() {
{'fraction_non_alphanumeric': 0.1371571072319202, 'fraction_numerical': 0.011471321695760598, 'mean_word_length': 3.5373303167420813, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 27, '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': '4887265', 'n_tokens_mistral': 1562, 'n_tokens_neox': 1303, 'n_words': 372}