package ca.carleton.gcrc.atlas.module.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Vector;

import ca.carleton.gcrc.atlas.module.Layer;
import ca.carleton.gcrc.atlas.module.LayerVariable;

public class LayerImpl extends IdentifiableImpl implements Layer {
	private String name;
	private Map<String,String> dataSourceMonitoring = new HashMap<String,String>();
	private List<LayerVariable> variables = new Vector<LayerVariable>();
	
	public LayerImpl(String layerName) {
		this.name = layerName;
	}
	
	public String getName() {
		return name;
	}
	
	@Override
	public void addDataSourceMonitoring(String dataSourceId, String atomUid) {
		dataSourceMonitoring.put(dataSourceId, atomUid);
	}
	
	@Override
	public Map<String, String> getDataSourceMonitoring() {
		return dataSourceMonitoring;
	}

	@Override
	public List<LayerVariable> getVariables() {
		List<LayerVariable> result = new Vector<LayerVariable>();
		result.addAll(variables);
		return result;
	}

	@Override
	public void addVariable(LayerVariable variable) {
		variables.add(variable);
	}

	@Override
	public void removeVariable(LayerVariable variable) {
		variables.remove(variable);
	}
}
