<commit_before>package org.drpowell.vcf;

import java.util.AbstractCollection;
import java.util.ArrayList;
import java.util.Iterator;

public class VCFMemoryCollection extends AbstractCollection<VCFVariant> {
	private final ArrayList<VCFVariant> variants = new ArrayList<VCFVariant>();
	private VCFHeaders headers;
	
	public VCFMemoryCollection(VCFParser parser) {
		for (VCFVariant v: parser) {
			variants.add(v);
		}
		headers = parser.getHeaders();
	}
	
	public VCFHeaders getHeaders() {
		return headers;
	}

	@Override
	public Iterator<VCFVariant> iterator() {
		return variants.iterator();
	}

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

}
<commit_msg>implement list instead of collection for random access<commit_after>package org.drpowell.vcf;

import java.util.AbstractList;
import java.util.ArrayList;
import java.util.Iterator;

public class VCFMemoryCollection extends AbstractList<VCFVariant> {
	private final ArrayList<VCFVariant> variants = new ArrayList<VCFVariant>();
	private VCFHeaders headers;
	
	public VCFMemoryCollection(VCFParser parser) {
		for (VCFVariant v: parser) {
			variants.add(v);
		}
		headers = parser.getHeaders();
	}
	
	public VCFHeaders getHeaders() {
		return headers;
	}

	@Override
	public Iterator<VCFVariant> iterator() {
		return variants.iterator();
	}

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

	@Override
	public VCFVariant get(int index) {
		return variants.get(index);
	}

}

{'fraction_non_alphanumeric': 0.10314207650273224, 'fraction_numerical': 0.0, 'mean_word_length': 4.955284552845528, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5392336', 'n_tokens_mistral': 489, 'n_tokens_neox': 452, 'n_words': 112}