package speiger.src.coreengine.utils.tasks;

import java.util.concurrent.Callable;

public class ArrayRunCall implements Callable<Runnable>
{
	Callable<Runnable>[] calls;

	@SafeVarargs
	public ArrayRunCall(Callable<Runnable>... calls) {
		this.calls = calls;
	}
	
	@Override
	public Runnable call() throws Exception {
		Runnable[] array = new Runnable[calls.length];
		for(int i = 0,m=array.length;i<m;i++) {
			array[i] = calls[i].call();
		}
		return new ArrayRunnable(array);
	}
}
