<commit_before>package Cache;

import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Iterator;
import Cache.CacheItem.CacheReason;

public class Cache {

	// Invariant: cacheTable.size() <= size;

	private int size;
	Hashtable<Integer, CacheItem> cacheTable = new Hashtable<Integer, CacheItem>();

	CacheReplacement policy;
	String startDate;
	int repID;

	private int time = 0;

	public Cache(int cacheSize, CacheReplacement pol, String start, int rep) {
		size = cacheSize;
		policy = pol;
		startDate = start;
		repID = rep;
	}

	public boolean isFull() {
		int currentCacheSize = cacheTable.size();
		assert (currentCacheSize <= size); // TODO: debug interaction
		return currentCacheSize == size;
	}

	// XXX: load a chunk at a time??
	public void load(CacheItem cacheItem) {
		int entityId = cacheItem.getEntityId();
		if (isFull())
			bumpOutItem();
		cacheTable.put(entityId, cacheItem);
	}

	public void add(int eid, int cid, String cdate, CacheReason reason) {
		// XXX move hit/miss logic here?
		if (cacheTable.containsKey(eid))
			cacheTable.get(eid).update(cid, cdate, startDate);
		else
			load(new CacheItem(eid, cid, cdate, reason, this));
	}

	public void add(ArrayList<Integer> eids, int cid, String cdate,
			CacheReason reas) {
		for (int eid : eids)
			add(eid, cid, cdate, reas);
	}

	public void remove(int fileid) {
		cacheTable.remove(fileid);
	}
<commit_msg>delete some unused lines of code<commit_after>package Cache;

import java.util.ArrayList;
import java.util.Hashtable;
import java.util.Iterator;
import Cache.CacheItem.CacheReason;

public class Cache {

	// Invariant: cacheTable.size() <= size;

	private int size;
	Hashtable<Integer, CacheItem> cacheTable = new Hashtable<Integer, CacheItem>();

	CacheReplacement policy;
	String startDate;
	int repID;

	private int time = 0;

	public Cache(int cacheSize, CacheReplacement pol, String start, int rep) {
		size = cacheSize;
		policy = pol;
		startDate = start;
		repID = rep;
	}

	public boolean isFull() {
		int currentCacheSize = cacheTable.size();
		assert (currentCacheSize <= size); // TODO: debug interaction
		return currentCacheSize == size;
	}

	// XXX: load a chunk at a time??
	public void load(CacheItem cacheItem) {
		int entityId = cacheItem.getEntityId();
		if (isFull())
			bumpOutItem();
		cacheTable.put(entityId, cacheItem);
	}

	public void add(int eid, int cid, String cdate, CacheReason reason) {
		if (cacheTable.containsKey(eid))
			cacheTable.get(eid).update(cid, cdate, startDate);
		else
			load(new CacheItem(eid, cid, cdate, reason, this));
	}

	public void add(ArrayList<Integer> eids, int cid, String cdate,
			CacheReason reas) {
		for (int eid : eids)
			add(eid, cid, cdate, reas);
	}

	public void remove(int fileid) {
		cacheTable.remove(fileid);
	}

{'fraction_non_alphanumeric': 0.11532951289398281, 'fraction_numerical': 0.0007163323782234957, 'mean_word_length': 4.279773156899811, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 9, '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': '4852375', 'n_tokens_mistral': 1002, 'n_tokens_neox': 932, 'n_words': 272}