package org.keyscience.SingletonPattern;

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

public class LabsSingletonList<T> {

    private List<T> list;
    private static LabsSingletonList instance = null;

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


    public static LabsSingletonList getListInstance() {
        if (instance == null)
            instance = new LabsSingletonList();

        return instance;
    }

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

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

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

    public List getList() {
        return list;
    }
}
