package org.keyscience.SingletonPattern;

import org.keyscience.models.LeaderBoardModel;

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

public class LeaderBoardList {

    private List<LeaderBoardModel> list;
    private static LeaderBoardList instance;

    private LeaderBoardList() {
        list = new ArrayList<>();
    }

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

    public void add(LeaderBoardModel model) {
        list.add(model);
    }

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

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

    public List getList() {
        return list;
    }
}
