<commit_before>package net.quasardb.qdb;

import net.quasardb.qdb.jni.*;
import java.util.ArrayList;

public class QdbColumnCollection <T> extends ArrayList<QdbColumnValue <T> > {
    QdbColumnDefinition column;

    protected QdbColumnCollection (QdbColumnDefinition column) {
        super();
        this.column = column;
    }

    QdbColumnDefinition getColumn() {
        return this.column;
    }

    public void insert(T value) {<commit_msg>Implements utility function to derive ranges from a columncolletion<commit_after>package net.quasardb.qdb;

import net.quasardb.qdb.jni.*;
import java.util.ArrayList;

public class QdbColumnCollection <T> extends ArrayList<QdbColumnValue <T> > {
    QdbColumnDefinition column;

    protected QdbColumnCollection (QdbColumnDefinition column) {
        super();
        this.column = column;
    }

    QdbColumnDefinition getColumn() {
        return this.column;
    }

    /**
     * Returns the interval that contains all values within this column.
     */
    public QdbTimeRange range() {
        QdbTimeRange cur = null;

        for (QdbColumnValue <T> val : this) {
            if (cur == null ){
                cur = new QdbTimeRange(val.getTimestamp(), val.getTimestamp());
            } else {
                if (val.getTimestamp().value.isBefore(cur.begin.value)) {
                    cur.begin = val.getTimestamp();
                }

                if (val.getTimestamp().value.isAfter(cur.end.value)) {
                    cur.end = val.getTimestamp();
                }
            }
        }

        System.out.println("cur = " + cur.toString());


        return cur;
    }

    public void insert(T value) {
{'fraction_non_alphanumeric': 0.10344827586206896, 'fraction_numerical': 0.0, 'mean_word_length': 2.2365384615384616, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 10, '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': '4936259', 'n_tokens_mistral': 489, 'n_tokens_neox': 468, 'n_words': 109}