<commit_before>/*
 *  Copyright (C) 2010 <NAME> <romain.reuillon at openmole.org>
 * 
 *  This program 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.
 * 
 *  This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.openmole.core.implementation.data;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import org.openmole.core.model.data.IData;
import org.openmole.core.model.data.IDataSet;
import org.openmole.core.model.data.IPrototype;

/**
 *
 * @author <NAME> <romain.reuillon at openmole.org>
 */
public class DataSet implements IDataSet {

    final List<IData<?>> data;

    public DataSet(IDataSet... datasets) {
        List<IData<?>> tmpdata = new LinkedList<IData<?>>();
        for (int i = 0; i < datasets.length; i++) {
            for (IData d : datasets[i]) {
                tmpdata.add(d);
            }
        }
        data = tmpdata;
    }

    public DataSet(List<IData<?>> data) {
        this.data = data;
    }

    public DataSet(IData<?>... data) {
        this.data = Arrays.asList(data);
    }

    public DataSet(IPrototype<?>... prototypes) {
        List<IData<?>> data = new ArrayList<IData<?>>(prototypes.length);
        for(int i = 0; i < prototypes.length; i++) {
            data.add(new Data(prototypes[i]));
        }
        this.data = data;
    }

    public DataSet(DataMod dataMod, IPrototype<?>... prototypes) {
        List<IData<?>> data = new ArrayList<IData<?>>(prototypes.length);
        for(int i = 0; i < prototypes.length; i++) {
            data.add(new Data(prototypes[i], dataMod));
        }
        this.data = data;
    }

    public DataSet(Iterable<IData> dataSet, IPrototype<?>... prototypes) {
        List<IData<?>> data = new ArrayList<IData<?>>(prototypes.length);
        for(IData d: dataSet) {
            data.add(d);
        }

        for(int i = 0; i < prototypes.length; i++) {
            data.add(new Data(prototypes[i]));
        }
        this.data = data;
    }

    public DataSet(Iterable<IData> dataSet, DataMod dataMod, IPrototype<?>... prototypes) {
        List<IData<?>> data = new ArrayList<IData<?>>(prototypes.length);
        for(IData d: dataSet) {
            data.add(d);
        }

        for(int i = 0; i < prototypes.length; i++) {
            data.add(new Data(prototypes[i], dataMod));
        }

        this.data = data;
    }

    public DataSet(Iterable<IData> dataSet, IData... inData) {
        List<IData<?>> data = new ArrayList<IData<?>>(inData.length);
        for(IData d: dataSet) {
            data.add(d);
        }

        for(IData d: inData) {
            data.add(d);
        }
        this.data = data;
    }

    public DataSet(List<IData<?>> data) {
        this.data = data;
    }

    @Override
    public Iterator<IData<?>> iterator() {
        return data.iterator();
    }

    @Override
    public int size() {
        return data.size();
    }

}
<commit_msg>Compilation fix.<commit_after>/*
 *  Copyright (C) 2010 <NAME> <romain.reuillon at openmole.org>
 * 
 *  This program 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.
 * 
 *  This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.
 */
package org.openmole.core.implementation.data;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import org.openmole.core.model.data.IData;
import org.openmole.core.model.data.IDataSet;
import org.openmole.core.model.data.IPrototype;

/**
 *
 * @author <NAME> <romain.reuillon at openmole.org>
 */
public class DataSet implements IDataSet {

    final List<IData<?>> data;

    public DataSet(IDataSet... datasets) {
        List<IData<?>> tmpdata = new LinkedList<IData<?>>();
        for (int i = 0; i < datasets.length; i++) {
            for (IData d : datasets[i]) {
                tmpdata.add(d);
            }
        }
        data = tmpdata;
    }

    public DataSet(List<IData<?>> data) {
        this.data = data;
    }

    public DataSet(IData<?>... data) {
        this.data = Arrays.asList(data);
    }

    public DataSet(IPrototype<?>... prototypes) {
        List<IData<?>> data = new ArrayList<IData<?>>(prototypes.length);
        for(int i = 0; i < prototypes.length; i++) {
            data.add(new Data(prototypes[i]));
        }
        this.data = data;
    }

    public DataSet(DataMod dataMod, IPrototype<?>... prototypes) {
        List<IData<?>> data = new ArrayList<IData<?>>(prototypes.length);
        for(int i = 0; i < prototypes.length; i++) {
            data.add(new Data(prototypes[i], dataMod));
        }
        this.data = data;
    }

    public DataSet(Iterable<IData> dataSet, IPrototype<?>... prototypes) {
        List<IData<?>> data = new ArrayList<IData<?>>(prototypes.length);
        for(IData d: dataSet) {
            data.add(d);
        }

        for(int i = 0; i < prototypes.length; i++) {
            data.add(new Data(prototypes[i]));
        }
        this.data = data;
    }

    public DataSet(Iterable<IData> dataSet, DataMod dataMod, IPrototype<?>... prototypes) {
        List<IData<?>> data = new ArrayList<IData<?>>(prototypes.length);
        for(IData d: dataSet) {
            data.add(d);
        }

        for(int i = 0; i < prototypes.length; i++) {
            data.add(new Data(prototypes[i], dataMod));
        }

        this.data = data;
    }

    public DataSet(Iterable<IData> dataSet, IData... inData) {
        List<IData<?>> data = new ArrayList<IData<?>>(inData.length);
        for(IData d: dataSet) {
            data.add(d);
        }

        for(IData d: inData) {
            data.add(d);
        }
        this.data = data;
    }

    @Override
    public Iterator<IData<?>> iterator() {
        return data.iterator();
    }

    @Override
    public int size() {
        return data.size();
    }

}

{'fraction_non_alphanumeric': 0.1370258185489687, 'fraction_numerical': 0.0028847540747151306, 'mean_word_length': 2.3481409946885563, 'pattern_counts': {'":': 0, '<': 101, '<?xml version=': 0, '>': 91, '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': '382757', 'n_tokens_mistral': 2241, 'n_tokens_neox': 2181, 'n_words': 576}