Newer
Older
AlgebraicDataflowArchitectureModel / AlgebraicDataflowArchitectureModel / src / models / controlFlowModel / CompositeCallEdgeAttribute.java
package models.controlFlowModel;

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

public class CompositeCallEdgeAttribute extends CallEdgeAttribute {
	private CallEdgeAttribute currentEdgeAttr = null;
	private List<CallEdgeAttribute> mergedCallEdgeAttrs = null;
	
	/*************************************************************
	 *  [ *constructor ]
	/*************************************************************
	 * 
	 */
	public CompositeCallEdgeAttribute(final CallEdgeAttribute callEdgeAttr) {
		super(callEdgeAttr.getCallEdge(), 
			  callEdgeAttr.getOriginalSourceObjectNode(),
			  callEdgeAttr.getSourceCell(), callEdgeAttr.getDestinationCell()
			  );
		
		this.currentEdgeAttr = (this.currentEdgeAttr == null)
							   ? callEdgeAttr : null;		
	}
	
	/*************************************************************
	 *  [ *public ]
	/*************************************************************
	 * 
	 */
	public void mergeCallEdgeAttribute(final CallEdgeAttribute mergedCallEdgeAttr) {
		if(this.currentEdgeAttr == null) return;
		if(this.mergedCallEdgeAttrs == null) this.mergedCallEdgeAttrs = new ArrayList<CallEdgeAttribute>();
		this.mergedCallEdgeAttrs.add(mergedCallEdgeAttr);
	}

}