<commit_before>package org.helioviewer.jhv.data.guielements.model;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import javax.swing.table.AbstractTableModel;

import org.helioviewer.jhv.data.datatype.event.JHVEventParameter;

/**
 * The model for parameter table panel.
 *
 * @author <NAME> (<EMAIL>)
 *
 */
@SuppressWarnings({ "serial" })
public class ParameterTableModel extends AbstractTableModel {

    /** The parameters in this model */
    private final List<JHVEventParameter> parameters;

    /**
     * Creates a parameter model for the given parameters.
     *
     * @param parameters
     *            the parameters
     */
    public ParameterTableModel(Collection<JHVEventParameter> parameters) {
        super();
        this.parameters = new ArrayList<JHVEventParameter>();
        this.parameters.addAll(parameters);
    }

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

    @Override
    public int getColumnCount() {
        return 2;
    }

    @Override
    public Class<?> getColumnClass(int columnIndex) {
        if (columnIndex == 1) {
            return String.class;
        } else {
            return super.getColumnClass(columnIndex);
        }
    }

    @Override
    public Object getValueAt(int rowIndex, int columnIndex) {
        if (rowIndex < parameters.size()) {
            if (columnIndex == 0) {
                return parameters.get(rowIndex).getParameterDisplayName();
            } else if (columnIndex == 1) {
                String result = parameters.get(rowIndex).getDisplayParameterValue();
                if (result.length() > 100) {
                    return result.substring(0, 100) + "...";
                } else {
                    return result;
                }
            } else {
                return null;
            }
        } else {
            return null;
        }
    }

    @Override
    public String getColumnName(int column) {
        if (column == 0) {
            return "Parameter Name";
        } else if (column == 1) {
            return "Value";
        } else {
            return super.getColumnName(column);
        }
    }

}<commit_msg>Allow longer strings (for URLs)<commit_after>package org.helioviewer.jhv.data.guielements.model;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

import javax.swing.table.AbstractTableModel;

import org.helioviewer.jhv.data.datatype.event.JHVEventParameter;

/**
 * The model for parameter table panel.
 *
 * @author <NAME> (<EMAIL>)
 *
 */
@SuppressWarnings("serial")
public class ParameterTableModel extends AbstractTableModel {

    /** The parameters in this model */
    private final List<JHVEventParameter> parameters;

    private static final int STRING_CUTOFF = 256;

    /**
     * Creates a parameter model for the given parameters.
     *
     * @param parameters
     *            the parameters
     */
    public ParameterTableModel(Collection<JHVEventParameter> parameters) {
        super();
        this.parameters = new ArrayList<JHVEventParameter>();
        this.parameters.addAll(parameters);
    }

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

    @Override
    public int getColumnCount() {
        return 2;
    }

    @Override
    public Class<?> getColumnClass(int columnIndex) {
        if (columnIndex == 1) {
            return String.class;
        } else {
            return super.getColumnClass(columnIndex);
        }
    }

    @Override
    public Object getValueAt(int rowIndex, int columnIndex) {
        if (rowIndex < parameters.size()) {
            if (columnIndex == 0) {
                return parameters.get(rowIndex).getParameterDisplayName();
            } else if (columnIndex == 1) {
                String result = parameters.get(rowIndex).getDisplayParameterValue();
                if (result.length() > STRING_CUTOFF) {
                    return result.substring(0, STRING_CUTOFF) + "...";
                } else {
                    return result;
                }
            } else {
                return null;
            }
        } else {
            return null;
        }
    }

    @Override
    public String getColumnName(int column) {
        if (column == 0) {
            return "Parameter Name";
        } else if (column == 1) {
            return "Value";
        } else {
            return super.getColumnName(column);
        }
    }

}
{'fraction_non_alphanumeric': 0.1027351567711808, 'fraction_numerical': 0.005114520791638871, 'mean_word_length': 1.945645055664702, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '6349250', 'n_tokens_mistral': 1253, 'n_tokens_neox': 1187, 'n_words': 287}