<commit_before>package com.tinkerpop.pipes.sideeffect;


import com.tinkerpop.pipes.AbstractPipe;

import java.util.Collection;
import java.util.LinkedList;

/**
 * The AggregatorPipe produces a side effect that is the provided Collection filled with the contents of all the objects that have passed through it.
 * The incoming objects are emitted as is.
 * Note that different Collections have different behaviors and write/read times.
 *
 * @author <NAME> (http://markorodriguez.com)
 */
public class AggregatorPipe<S> extends AbstractPipe<S, S> implements SideEffectPipe<S, S, Collection<S>> {

    private final Collection<S> aggregate;

    public AggregatorPipe() {
        this.aggregate = new LinkedList<S>();
    }

    public AggregatorPipe(final Collection<S> collection) {
        this.aggregate = collection;
    }

    protected S processNextStart() {
        final S start = this.starts.next();
        this.aggregate.add(start);
        return start;
    }

    public Collection<S> getSideEffect() {
        return this.aggregate;
    }
}<commit_msg>minor documentation.<commit_after>package com.tinkerpop.pipes.sideeffect;


import com.tinkerpop.pipes.AbstractPipe;

import java.util.Collection;
import java.util.LinkedList;

/**
 * The AggregatorPipe produces a side effect that is the provided Collection filled with the contents of all the objects that have passed through it.
 * The incoming objects are emitted as is.
 * Note that different Collections have different behaviors and write/read times.
 *
 * @author <NAME> (http://markorodriguez.com)
 */
public class AggregatorPipe<S> extends AbstractPipe<S, S> implements SideEffectPipe<S, S, Collection<S>> {

    private final Collection<S> aggregate;

    /**
     * Construct an AggregatorPipe where the default collection is a LinkedList<S>.
     */
    public AggregatorPipe() {
        this.aggregate = new LinkedList<S>();
    }

    /**
     * Construct an AggregatorPipe with the collection that is add()ed to is provided.
     *
     * @param collection the provided collection
     */
    public AggregatorPipe(final Collection<S> collection) {
        this.aggregate = collection;
    }

    protected S processNextStart() {
        final S start = this.starts.next();
        this.aggregate.add(start);
        return start;
    }

    public Collection<S> getSideEffect() {
        return this.aggregate;
    }
}
{'fraction_non_alphanumeric': 0.0925, 'fraction_numerical': 0.0, 'mean_word_length': 3.3339350180505414, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 22, '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': '3955833', 'n_tokens_mistral': 702, 'n_tokens_neox': 671, 'n_words': 212}