/** Return whether lookahead sets are disjoint; no lookahead ⇒ not disjoint */ public static boolean disjoint(IntervalSet[] altLook) { boolean collision = false; IntervalSet combined = new IntervalSet(); if ( altLook==null ) return false; for (IntervalSet look : altLook) { if ( look==null ) return false; // lookahead must've computation failed if ( !look.and(combined).isNil() ) { collision = true; break; } combined.addAll(look); } return !collision; } }
/** Return whether lookahead sets are disjoint; no lookahead => not disjoint */ public static boolean disjoint(IntervalSet[] altLook) { boolean collision = false; IntervalSet combined = new IntervalSet(); if ( altLook==null ) return false; for (IntervalSet look : altLook) { if ( look==null ) return false; // lookahead must've computation failed if ( !look.and(combined).isNil() ) { collision = true; break; } combined.addAll(look); } return !collision; } }
/** Return whether lookahead sets are disjoint; no lookahead ⇒ not disjoint */ public static boolean disjoint(IntervalSet[] altLook) { boolean collision = false; IntervalSet combined = new IntervalSet(); if ( altLook==null ) return false; for (IntervalSet look : altLook) { if ( look==null ) return false; // lookahead must've computation failed if ( !look.and(combined).isNil() ) { collision = true; break; } combined.addAll(look); } return !collision; } }
/** Return whether lookahead sets are disjoint; no lookahead ⇒ not disjoint */ public static boolean disjoint(IntervalSet[] altLook) { boolean collision = false; IntervalSet combined = new IntervalSet(); if ( altLook==null ) return false; for (IntervalSet look : altLook) { if ( look==null ) return false; // lookahead must've computation failed if ( !look.and(combined).isNil() ) { collision = true; break; } combined.addAll(look); } return !collision; } }
/** Return whether lookahead sets are disjoint; no lookahead ⇒ not disjoint */ public static boolean disjoint(IntervalSet[] altLook) { boolean collision = false; IntervalSet combined = new IntervalSet(); if ( altLook==null ) return false; for (IntervalSet look : altLook) { if ( look==null ) return false; // lookahead must've computation failed if ( !look.and(combined).isNil() ) { collision = true; break; } combined.addAll(look); } return !collision; } }