package ua.be.typeOperations.model.csv;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;

import ua.be.typeOperations.model.csv.operations.OutlierDetectionOperation;
import ua.be.typeOperations.model.util.Operation;

public class CSVOperationManager {

	private Operation operation;
	
	private static CSVOperationManager instance;
	
	private CSVOperationManager() {
	
	}
	
	public static CSVOperationManager getInstance() {
		if (instance == null) {
			instance = new CSVOperationManager();
		}
		return instance;
	}
		
	public String executeCSVOperation(File csv) throws IOException {
		if (csv != null && csv.exists()) {
			operation.setFile(csv);
			return operation.execute();
		}
		throw new FileNotFoundException("The csv file does not exist!");
		
	}
	
	public void setOperation(Operation op) {
		operation = op;
	}
	
	
}
