/** * Called when a change is made to a configuration node, such that its dependency graph * <em>may</em> now be larger than it previously was, and the node should be visited. */ public void onMoreSelected(ConfigurationNode configuration) { // Add to the end of the queue, so that we traverse the graph in breadth-wise order to pick up // as many conflicts as // possible before attempting to resolve them if (queued.add(configuration)) { queue.addLast(configuration); } }
/** * Called when a change is made to a configuration node, such that its dependency graph * <em>may</em> now be smaller than it previously was, and the node should be visited. */ public void onFewerSelected(ConfigurationNode configuration) { // Add to the front of the queue, to flush out configurations that are no longer required. if (queued.add(configuration)) { queue.addFirst(configuration); } }
public ConfigurationNode pop() { ConfigurationNode next = queue.removeFirst(); queued.remove(next); return next; }
public ConfigurationNode peek() { return queue.isEmpty() ? null : queue.getFirst(); }