<commit_before>/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package solution;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 *
 */

public class Models implements Iterable<Model> {
    private List<Model> models = new ArrayList<Model>();
    private Solver solverInterface;

    public Models(Solver solverThatProducesTheModels) {
	this.solverInterface = solverThatProducesTheModels;
    }

    @Override
    public Iterator<Model> iterator() {
	return new ModelsIterator(models,solverInterface);
    }

    public void export() {
        // TODO incrément 2
    }
}<commit_msg>Added many comments, you should understand every change now :)<commit_after>/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package solution;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * This class is the Model container. An instance of Models
 * allows the user to iterate (with iterate()) on the different
 * models. When using ModelsIterator.hasNext(), the
 * Solver.nextModel() will be called and the next model will
 * be automatically retrieved.
 */
public class Models implements Iterable<Model> {
    private List<Model> models = new ArrayList<Model>();
    private Solver solverInterface; // The solver that created this inst. of Models
    // Models will operate on the Solver instance as the user calls hasNext() when
    // iterating

    /**
     * Create an instance of Models; you need to pass the Solver instance
     * that created this instance of Models because Models will call
     * Solver.nextModel() when you do ModelsIterator.hasNext().
     * This constructor is protected because it should only be used
     * by Solver and not by the end user.
     *
     * @param solverThatProducesTheModels
     */
    protected Models(Solver solverThatProducesTheModels) {
	this.solverInterface = solverThatProducesTheModels;
    }

    /**
     * This iterator allows the user to iterate over the Model instances.
     * The whole list of Model is not computed before getting the first
     * Model: this list is built "on the fly", when the user uses
     * ModelsIterator.hasNext().
     */
    @Override
    public Iterator<Model> iterator() {
    	return new ModelsIterator(models,solverInterface);
    }

    /**
     * Exports the models already computed.
     * @param fileName
     */
    public void exportTo(String fileName) {
        // TODO incrément 2
    }
}
{'fraction_non_alphanumeric': 0.07895703268453912, 'fraction_numerical': 0.0007344840249724568, 'mean_word_length': 3.3033175355450237, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '2608567', 'n_tokens_mistral': 731, 'n_tokens_neox': 701, 'n_words': 291}