<commit_before>package info.limpet.data.impl;

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

import info.limpet.ICommand;
import info.limpet.ITemporalObjectCollection;
import info.limpet.data.impl.helpers.TimeHelper;

public class TemporalObjectCollection<T extends Object> extends
		ObjectCollection<T> implements ITemporalObjectCollection<T>
{

	ArrayList<Long> times = new ArrayList<Long>();
	transient TimeHelper tSupport;

	public TemporalObjectCollection(String name)
	{
		this(name, null);
	}

	public TemporalObjectCollection(String name, ICommand<?> precedent)
	{
		super(name, precedent);

		initTime();
	}

	@Override
	public void clearQuiet()
	{
		times.clear();

		// let the parent clear the objects/values
		super.clearQuiet();
	}

	@Override
	public void clear()
	{
		times.clear();

		// let the parent clear the objects/values
		super.clear();
	}

	protected void initTime()
	{
		if (tSupport == null)
		{
			tSupport = new TimeHelper(times);
		}
	}

	@Override
	public List<Long> getTimes()
	{
		return tSupport.getTimes();
	}

	@Override
	public void add(T value)
	{<commit_msg>hotfix - we need to initialise the time before using time support<commit_after>package info.limpet.data.impl;

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

import info.limpet.ICommand;
import info.limpet.ITemporalObjectCollection;
import info.limpet.data.impl.helpers.TimeHelper;

public class TemporalObjectCollection<T extends Object> extends
		ObjectCollection<T> implements ITemporalObjectCollection<T>
{

	ArrayList<Long> times = new ArrayList<Long>();
	transient TimeHelper tSupport;

	public TemporalObjectCollection(String name)
	{
		this(name, null);
	}

	public TemporalObjectCollection(String name, ICommand<?> precedent)
	{
		super(name, precedent);

		initTime();
	}

	@Override
	public void clearQuiet()
	{
		times.clear();

		// let the parent clear the objects/values
		super.clearQuiet();
	}

	@Override
	public void clear()
	{
		times.clear();

		// let the parent clear the objects/values
		super.clear();
	}

	protected void initTime()
	{
		if (tSupport == null)
		{
			tSupport = new TimeHelper(times);
		}
	}

	@Override
	public List<Long> getTimes()
	{
		initTime();
		return tSupport.getTimes();
	}

	@Override
	public void add(T value)
	{
{'fraction_non_alphanumeric': 0.11168384879725086, 'fraction_numerical': 0.0, 'mean_word_length': 4.416279069767442, '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': '5936657', 'n_tokens_mistral': 810, 'n_tokens_neox': 750, 'n_words': 185}