<commit_before>package fr.laas.fape.structures;

import java.util.*;

public class IRSet<T extends Identifiable> implements Set<T> {
    private final IntRep<T> intRep;
    private final BitSet bitset;

    public IRSet(IntRep<T> intRep) {
        this.intRep = intRep;
        bitset = new BitSet();
    }
    public IRSet(IntRep<T> intRep, BitSet values) {
        this.intRep = intRep;
        bitset = values;
    }
    @Override
    public int size() {
        return bitset.cardinality();
    }

    @Override
    public boolean isEmpty() {
        return size() == 0;
    }

    @Override @SuppressWarnings("unchecked")
    public boolean contains(Object o) {
        return contains(((Identifiable) o).getID());
    }<commit_msg>Factory method for singleton in IRSet.<commit_after>package fr.laas.fape.structures;

import java.util.*;

public class IRSet<T extends Identifiable> implements Set<T> {
    private final IntRep<T> intRep;
    private final BitSet bitset;

    public IRSet(IntRep<T> intRep) {
        this.intRep = intRep;
        bitset = new BitSet();
    }
    public IRSet(IntRep<T> intRep, BitSet values) {
        this.intRep = intRep;
        bitset = values;
    }
    public static <T extends Identifiable> IRSet<T> ofSingleton(IntRep<T> intRep, T value) {
        IRSet<T> x = new IRSet<>(intRep);
        x.add(value);
        return x;
    }
    @Override
    public int size() {
        return bitset.cardinality();
    }

    @Override
    public boolean isEmpty() {
        return size() == 0;
    }

    @Override @SuppressWarnings("unchecked")
    public boolean contains(Object o) {
        return contains(((Identifiable) o).getID());
    }
{'fraction_non_alphanumeric': 0.11488095238095238, 'fraction_numerical': 0.0011904761904761906, 'mean_word_length': 2.607296137339056, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, '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': '7247721', 'n_tokens_mistral': 531, 'n_tokens_neox': 523, 'n_words': 138}