package org.eclipse.cosmos.me.sdd.tooling.btg.aggregator.comparisons;

import java.util.Iterator;
import java.util.List;

import org.eclipse.cosmos.me.sdd.schema.OperationType;

public class OperationCompare
{

	protected static boolean equals(List<OperationType> operation,	List<OperationType> operation2)
	{
		if (operation.size()!=operation2.size())
			return false;
		
		Iterator <OperationType> iter = operation.iterator();
		
		while (iter.hasNext())
		{
			OperationType o = iter.next();
			
			Iterator <OperationType> iteoperation2 = operation2.iterator();
			boolean notfound = true;
			OperationType o2 = null;
			while (iteoperation2.hasNext()&&notfound)
			{
				o2 = iteoperation2.next();
				if (o.compareTo(o2)==0)
					notfound = false;
			}
			if (notfound)
				return false;
			else
				operation2.remove(o2);
		}
		
		return true;
		
	}

}
