HashSet<DetectorFactory> unassignedSet = new HashSet<DetectorFactory>(factoryMap.values()); unassignedSet.removeAll(assignedToPassSet); for (Iterator<DetectorFactory> i = unassignedSet.iterator(); i.hasNext();) { lastPass.addDetectorFactory(i.next());
Set<DetectorFactory> unassignedSet = getUnassignedSet(); for (DetectorFactory factory : unassignedSet) { assignToPass(factory, lastPass);
	public void build() throws OrderingConstraintException {		// Build inter-pass constraint graph		Map<String, DetectorNode> nodeMap = new HashMap<String, DetectorNode>();		ConstraintGraph interPassConstraintGraph = buildConstraintGraph(			nodeMap,			new HashSet<DetectorFactory>(factoryMap.values()),			interPassConstraintList);		if (DEBUG) System.out.println(interPassConstraintGraph.getNumVertices() +			" nodes in inter-pass constraint graph");		// Build list of analysis passes.		// This will assign all detectors referenced in inter- or intra-pass		// ordering constraints to passes.  Detectors with any ordering		// constraint will be left unassigned.		buildPassList(interPassConstraintGraph);				// If there are any unassigned detectors, add them to the final pass		// (creating one if required).		if (factoryMap.size() > assignedToPassSet.size()) {			AnalysisPass lastPass;			if (passList.isEmpty()) {				lastPass = new AnalysisPass();				passList.add(lastPass);			} else {				lastPass = passList.getLast();			}						HashSet<DetectorFactory> unassignedSet = new HashSet<DetectorFactory>(factoryMap.values());			unassignedSet.removeAll(assignedToPassSet);			for (Iterator<DetectorFactory> i = unassignedSet.iterator(); i.hasNext();) {				lastPass.addDetectorFactory(i.next());			}		}		// Sort detectors in each pass to satisfy intra-pass ordering constraints		for (Iterator<AnalysisPass> i = passList.iterator(); i.hasNext(); ) {			AnalysisPass pass = i.next();			sortPass(intraPassConstraintList, factoryMap, pass);		}	}