/*******************************************************************************
 * Copyright (c) 2008 SAS Institute Inc.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     SAS Institute Inc. - initial API and implementation
 ******************************************************************************/
package org.eclipse.cosmos.me.provisional.deployment.sdd.tooling.btg.aggregator;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;


import org.eclipse.cosmos.me.provisional.deployment.sdd.common.spi.requiredbase.AlternativeRequiredBaseConstraint;
import org.eclipse.cosmos.me.provisional.deployment.sdd.common.spi.requiredbase.RequiredBaseConstraint;
import org.eclipse.cosmos.me.provisional.deployment.sdd.common.spi.requirement.AlternativeRequirement;
import org.eclipse.cosmos.me.provisional.deployment.sdd.common.spi.requirement.Requirement;
import org.eclipse.cosmos.me.provisional.deployment.sdd.common.spi.requirement.RequirementResourceConstraint;



public class AlternativeRequiredBaseConstraintType {

	/*
	public static AlternativeRequiredBaseConstraint merge(AlternativeRequiredBaseConstraint constraint1, AlternativeRequiredBaseConstraint constraint2)
	 
	{	
		
		
	}
	*/
	
	public static boolean equals(AlternativeRequiredBaseConstraint constraint1, AlternativeRequiredBaseConstraint constraint2)
	{		
		boolean equals = true;
		
		Collection<RequiredBaseConstraint> requiredBaseConstraints1 = constraint1.getRequiredBaseConstraints();
		Collection<RequiredBaseConstraint> requiredBaseConstraints2 = constraint2.getRequiredBaseConstraints();
		
		Iterator<RequiredBaseConstraint> constraintsIter1 = requiredBaseConstraints1.iterator();	
		
		while ((constraintsIter1.hasNext())&&(equals))
		{
			RequiredBaseConstraint baseConstraint1 = constraintsIter1.next();
			
			Iterator<RequiredBaseConstraint> constraintsIter2 = requiredBaseConstraints2.iterator();
			while (constraintsIter2.hasNext())
			{
				RequiredBaseConstraint baseConstraint2 = constraintsIter2.next();
				//TODO remove after RequiredBaseConstraintType in place
				/*if ((RequiredBaseConstraintType.equals(baseConstraint1, baseConstraint2))==false)
				{
					equals=false;
				}
				*/
			}
		}
		
		return equals;
		
	}
}

