All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jadex.rules.eca.annotations.CombinedCondition Maven / Gradle / Ivy

There is a newer version: 4.0.267
Show newest version
package jadex.rules.eca.annotations;

import jadex.commons.Tuple2;
import jadex.commons.future.DelegationResultListener;
import jadex.commons.future.Future;
import jadex.commons.future.IFuture;
import jadex.rules.eca.ICondition;
import jadex.rules.eca.IEvent;

/**
 * 
 */
public class CombinedCondition implements ICondition
{
	/** The conditions. */
	protected ICondition[] conditions;
	
	/**
	 *  Create a new CombinedCondition.
	 */
	public CombinedCondition(ICondition[] conditions)
	{
		this.conditions = conditions;
	}
	
	/**
	 * 
	 */
	public IFuture> evaluate(IEvent event)
	{
		return doEvaluate(0, event);
//		Tuple2 ret = ICondition.TRUE;
//		
//		for(int i=0; ret.getFirstEntity().booleanValue() && i> doEvaluate(final int i, final IEvent event)
	{
		final Future> ret = new Future>();
		if(i>(ret)
			{
				public void customResultAvailable(Tuple2 result)
				{
					if(result.getFirstEntity().booleanValue())
					{
						if(i+1>(ret));
						}
						else
						{
							ret.setResult(result);
						}
					}
					else
					{
						ret.setResult(result);
					}
				}
			});
		}
		return ret;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy