package org.keyscience.SingletonPattern;

import android.annotation.SuppressLint;

import org.keyscience.models.EcoQuestModel;

import java.util.HashMap;

public class SingletonEcoQuests {

    private HashMap<Integer, EcoQuestModel> map;
    private static SingletonEcoQuests instance = null;

    @SuppressLint("UseSparseArrays")
    private SingletonEcoQuests() {
        map = new HashMap<>();
    }

    public static SingletonEcoQuests getInstance() {
        if (instance == null) {
            instance = new SingletonEcoQuests();
        }
        return instance;
    }

    public void put(int i, EcoQuestModel ecoQuestModel) {
        map.put(i, ecoQuestModel);
    }

    public void clear() {
        map.clear();
    }

    public int size() {
        return map.size();
    }

    public HashMap<Integer, EcoQuestModel> getHashMap() {
        return map;
    }
}
