package com.sw.mes.sap.task;

import java.util.LinkedList;
import java.util.List;

/**
 * @Author：liru
 * @Date：2024/4/12 12:15
 */
public class SapWorkinghoursQueueCache {
	
	private static SapWorkinghoursQueueCache sapWorkinghoursQueueCache;
	
	private List<Long> listSyn = new LinkedList<Long>();
	
	
	private SapWorkinghoursQueueCache() {
	}
	
	public static SapWorkinghoursQueueCache getInstance() {
		if(sapWorkinghoursQueueCache==null) {
			sapWorkinghoursQueueCache = new SapWorkinghoursQueueCache();
		}
		
		return sapWorkinghoursQueueCache;
	}
	
	public int getCacheSize() {
		return listSyn.size();
	}
	
	public synchronized void addCache(Long id) {
		listSyn.add(id);
	}
	
	
	public synchronized void remove(Long id) {
		listSyn.remove(id);
	}
	
	
	public synchronized void remove(int index) {
		listSyn.remove(index);
	}
	
	public Long get(int index) {
		return listSyn.get(index);
	}
	
}
