<commit_before>package ixa.kaflib;

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

public class Targets<T> {

    private AnnotationContainer annotationContainer;
    //private List<String> targets;
    private List<T> targets;
    private int headIndex;

    Targets(AnnotationContainer annotationContainer) {
	this.annotationContainer = annotationContainer;
	this.targets = new ArrayList();
	this.headIndex = -1;
    }

    public List<T> getTargets() {
	return this.targets;
    }

    public T getHead() {
	if (this.headIndex < 0) {
	    return null;
	}
	return this.targets.get(this.headIndex);
    }

    public void addTarget(T target) {
	this.targets.add(target);
    }

    public void addTarget(T target, boolean isHead) {
	this.targets.add(target);
	if (isHead) {
	    this.headIndex = this.targets.size() - 1;
	}
    }
}<commit_msg>'addTargets' method added to the Targets class.<commit_after>package ixa.kaflib;

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

public class Targets<T> {

    private AnnotationContainer annotationContainer;
    //private List<String> targets;
    private List<T> targets;
    private int headIndex;

    Targets(AnnotationContainer annotationContainer) {
	this.annotationContainer = annotationContainer;
	this.targets = new ArrayList();
	this.headIndex = -1;
    }

    public List<T> getTargets() {
	return this.targets;
    }

    public T getHead() {
	if (this.headIndex < 0) {
	    return null;
	}
	return this.targets.get(this.headIndex);
    }

    public void addTarget(T target) {
	this.targets.add(target);
    }

    public void addTarget(T target, boolean isHead) {
	this.targets.add(target);
	if (isHead) {
	    this.headIndex = this.targets.size() - 1;
	}
    }

    public void addTargets(List<T> targets) {
	this.targets.addAll(targets);
    }
}
{'fraction_non_alphanumeric': 0.1145374449339207, 'fraction_numerical': 0.003303964757709251, 'mean_word_length': 3.420924574209246, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 12, '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': '7134436', 'n_tokens_mistral': 619, 'n_tokens_neox': 576, 'n_words': 135}