package br.uem.din.architectureEvolution.representation;

import com.sdmetrics.model.ModelElement;

public class AssociationEnd {

	private ModelElement modelElement;
	private Class class_;
	private boolean isNavigable;
	private String aggregation;

	public AssociationEnd(ModelElement modelElement, Class c) {
		setModelElement(modelElement);		
		setCLSClass(c);
	}

	public ModelElement getModelElement() {
		return modelElement;
	}

	public void setModelElement(ModelElement modelElement) {
		this.modelElement = modelElement;
		
		boolean navigable = Boolean.parseBoolean(modelElement.getPlainAttribute("navigable"));
		setNavigable(navigable);
		setAggregation(modelElement.getPlainAttribute("aggregation"));
	}

	public Class getCLSClass() {
		return class_;
	}

	public void setCLSClass(Class c) {
		this.class_ = c;
	}

	public boolean isNavigable() {
		return isNavigable;
	}

	private void setNavigable(boolean isNavigable) {
		this.isNavigable = isNavigable;
	}

	public String getAggregation() {
		return aggregation;
	}

	private void setAggregation(String aggregation) {
		this.aggregation = aggregation;
	}
}
