package modules.gradient;

import utils.*;
import simulator.*;
import java.util.*;

public class MultiTypePropagation implements PropagationTest {
  private Vector tests = new Vector();
  private boolean finalized = false;

  public void addType(PropagationTest t) { if(!finalized) tests.add(t); }
  public void finalize() { finalized = true; }

  public boolean propagate(Gradient g, PortedProcessor pp) {
    Iterator i=tests.iterator();
    while(i.hasNext()) { 
      if(!((PropagationTest)i.next()).propagate(g,pp))
        return false;
    }
    return true;
  }
}
