<commit_before>package net.emaze.dysfunctional.multiplexing;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import net.emaze.dysfunctional.contracts.dbc;
import net.emaze.dysfunctional.iterations.ReadOnlyIterator;
import net.emaze.dysfunctional.options.Maybe;

/**
 * squared
 * @param <T> 
 * @author rferranti
 */
public class PreciseDemultiplexingIterator<T> extends ReadOnlyIterator<List<Maybe<T>>> {

    private final Iterator<Maybe<T>> iterator;
    private final int channelSize;

    public PreciseDemultiplexingIterator(int channelSize, Iterator<Maybe<T>> iterator) {
        dbc.precondition(channelSize > 0, "cannot build a PreciseDemultiplexingIterator with channelsCount < 1");
        dbc.precondition(iterator != null, "cannot build a PreciseDemultiplexingIterator with a null iterator");
        this.iterator = iterator;
        this.channelSize = channelSize;
    }

    @Override
    public boolean hasNext() {
        return iterator.hasNext();
    }

    @Override
    public List<Maybe<T>> next() {
        final List<Maybe<T>> out = new ArrayList<Maybe<T>>(channelSize);
        for (int i = 0; i != channelSize; ++i) {
            out.add(iterator.next());
        }
        return out;
    }

    @Override
    public void remove() {
        throw new UnsupportedOperationException("Cannot remove from a PreciseDemultiplexingIterator.");
    }
}<commit_msg>fix: unwanted override<commit_after>package net.emaze.dysfunctional.multiplexing;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import net.emaze.dysfunctional.contracts.dbc;
import net.emaze.dysfunctional.iterations.ReadOnlyIterator;
import net.emaze.dysfunctional.options.Maybe;

/**
 * squared
 * @param <T> 
 * @author rferranti
 */
public class PreciseDemultiplexingIterator<T> extends ReadOnlyIterator<List<Maybe<T>>> {

    private final Iterator<Maybe<T>> iterator;
    private final int channelSize;

    public PreciseDemultiplexingIterator(int channelSize, Iterator<Maybe<T>> iterator) {
        dbc.precondition(channelSize > 0, "cannot build a PreciseDemultiplexingIterator with channelsCount < 1");
        dbc.precondition(iterator != null, "cannot build a PreciseDemultiplexingIterator with a null iterator");
        this.iterator = iterator;
        this.channelSize = channelSize;
    }

    @Override
    public boolean hasNext() {
        return iterator.hasNext();
    }

    @Override
    public List<Maybe<T>> next() {
        final List<Maybe<T>> out = new ArrayList<Maybe<T>>(channelSize);
        for (int i = 0; i != channelSize; ++i) {
            out.add(iterator.next());
        }
        return out;
    }
}
{'fraction_non_alphanumeric': 0.10941570524748791, 'fraction_numerical': 0.002232973576479345, 'mean_word_length': 3.618556701030928, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 35, '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': '7154735', 'n_tokens_mistral': 820, 'n_tokens_neox': 773, 'n_words': 187}