<commit_before>package de.lmu.ifi.dbs.utilities.optionhandling;

import java.util.List;
import java.util.regex.Pattern;

/**
 * Abstract parameter class defining a parameter for a list of objects.
 * 
 * @author <NAME>
 *
 * @param <T>
 */
public abstract class ListParameter<T> extends Parameter<List<T>,ListParameter> {

	/**
	 * A pattern defining a &quot,&quot.
	 */
	public static final Pattern SPLIT = Pattern.compile(",");

	/**
	 * A pattern defining a &quot:&quot.
	 */
	public static final Pattern VECTOR_SPLIT = Pattern.compile(":");

	/**
	 * Constructs a list parameter with the given name and description.
	 * 
	 * @param name the parameter name
	 * @param description the parameter description
	 */
	public ListParameter(String name, String description) {
		super(name, description);
	}

	/**
	 * Returns the size of this list parameter.
	 * 
	 * @return the size of this list parameter.
	 */
	public int getListSize(){
		return this.value.size();
	}
	
	/**
	 * Returns a string representation of this list parameter.
	 * The elements of this list parameters are given in &quot;[  ]&quot;, comma separated.
	 * 
	 * @see java.lang.Object#toString()
	 */
	public String toString(){
		StringBuffer buffer = new StringBuffer();
		buffer.append("[");
		
		for(int i = 0; i<this.value.size(); i++){
			buffer.append(this.value.get(i).toString());
			if(i!=this.value.size()-1){
				buffer.append(",");
			}
		}		
		buffer.append("]");
		return buffer.toString();
	}
}
<commit_msg>bugfixing getListSize()<commit_after>package de.lmu.ifi.dbs.utilities.optionhandling;

import java.util.List;
import java.util.regex.Pattern;

/**
 * Abstract parameter class defining a parameter for a list of objects.
 * 
 * @author <NAME>
 *
 * @param <T>
 */
public abstract class ListParameter<T> extends Parameter<List<T>,ListParameter> {

	/**
	 * A pattern defining a &quot,&quot.
	 */
	public static final Pattern SPLIT = Pattern.compile(",");

	/**
	 * A pattern defining a &quot:&quot.
	 */
	public static final Pattern VECTOR_SPLIT = Pattern.compile(":");

	/**
	 * Constructs a list parameter with the given name and description.
	 * 
	 * @param name the parameter name
	 * @param description the parameter description
	 */
	public ListParameter(String name, String description) {
		super(name, description);
	}

	/**
	 * Returns the size of this list parameter.
	 * 
	 * @return the size of this list parameter.
	 */
	public int getListSize(){
    if (this.value == null) return 0;
    return this.value.size();
	}
	
	/**
	 * Returns a string representation of this list parameter.
	 * The elements of this list parameters are given in &quot;[  ]&quot;, comma separated.
	 * 
	 * @see java.lang.Object#toString()
	 */
	public String toString(){
		StringBuffer buffer = new StringBuffer();
		buffer.append("[");
		
		for(int i = 0; i<this.value.size(); i++){
			buffer.append(this.value.get(i).toString());
			if(i!=this.value.size()-1){
				buffer.append(",");
			}
		}		
		buffer.append("]");
		return buffer.toString();
	}
}

{'fraction_non_alphanumeric': 0.14257425742574256, 'fraction_numerical': 0.0016501650165016502, 'mean_word_length': 3.4903703703703703, 'pattern_counts': {'":': 2, '<': 15, '<?xml version=': 0, '>': 13, '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': '1371449', 'n_tokens_mistral': 1004, 'n_tokens_neox': 903, 'n_words': 280}