/** * Create a continuation object which is a cascade of four * continuation objects. * @param first the first Graph/Finder to try * @param second the second Graph/Finder to try * @param third the third Graph/Finder to try * @param fourth the third Graph/Finder to try */ public static Finder cascade(Finder first, Finder second, Finder third, Finder fourth) { return new Cascade(first, cascade(second, cascade(third, fourth))); }
/** * Create a continuation object which is a cascade of three * continuation objects. * @param first the first Graph/Finder to try * @param second the second Graph/Finder to try * @param third the third Graph/Finder to try */ public static Finder cascade(Finder first, Finder second, Finder third) { return new Cascade(first, cascade(second, third)); }
/** * Create a continuation object which is a cascade of two * continuation objects. * @param first the first Graph/Finder to try * @param second the second Graph/Finder to try */ public static Finder cascade(Finder first, Finder second) { if (first == null || (first instanceof FGraph && ((FGraph)first).getGraph() == null)) return second; if (second == null || (second instanceof FGraph && ((FGraph)second).getGraph() == null)) return first; return new Cascade(first, second); }