if (elementSet.isNeedingUpdate(visitor.getOrder()))
if (elementSet.isEnabled() && elementSet.isNeedingUpdate(visitor.getOrder()))
	public Collection visit(Collection elementSets, IElementSetVisitor visitor) throws CyclicSystemException {		int visitCounter = 0;		int mark = getNewMark(visitor.getOrder());		if (elementSets.isEmpty())			return Collections.EMPTY_SET;		Collection leaves = new LinkedList();		while (!elementSets.isEmpty()) {			Collection nextLevel = new LinkedList();			// first visit all element sets in the given set			for (Iterator elementSetsIter = elementSets.iterator(); elementSetsIter.hasNext();) {				ElementSet elementSet = (ElementSet) elementSetsIter.next();				// skip if already visited				if (mark == elementSet.getVisitedMark())					continue;				// last time was visited it has been changed, need to recompute				// only a change in a previous phase causes the next phase to need to recompute				if (elementSet.getVisitedMark() == elementSet.getChangedMark() && visitor.getOrder() > getVisitorOrder(elementSet.getChangedMark()))					elementSet.markNeedingUpdate(visitor.getOrder());				boolean shouldVisit = true;				for (Iterator ancestorIter = visitor.getAncestors(elementSet).iterator(); ancestorIter.hasNext();) {					ElementSet ancestorNode = (ElementSet) ancestorIter.next();					if (ancestorNode.getVisitedMark() != mark) {						// one ancestor element set has not been visited yet - bail out									shouldVisit = false;						break;					}					if (ancestorNode.getChangedMark() == mark)						// ancestor has changed - we need to recompute									elementSet.markNeedingUpdate(visitor.getOrder());				}				if (!shouldVisit)					continue;				elementSet.setVisitedMark(mark);				// only update if necessary				if (elementSet.isNeedingUpdate(visitor.getOrder()))					visitor.update(elementSet);				visitCounter++;				if (visitor.getDescendants(elementSet).isEmpty())					leaves.add(elementSet);				else					nextLevel.addAll(visitor.getDescendants(elementSet));			}			elementSets = nextLevel;		}		// if visited more nodes than exist in the graph, a cycle has been found		// XXX: is this condition enough for detecting a cycle?  		if (visitCounter != this.elementSets.size())			throw new CyclicSystemException(getCycleString());		return leaves;	}