sortedOutputs = sorted.iterator();
assert sorted.size() == getDestSet().size() : "error " + sorted.size() + "!= " + getDestSet().size(); sortedOutputs = sorted.subList(0, sorted.size());
    public Iterator getSortedOutputs()     {	if (sortedOutputs == null) {	    //if there are no dest just return an empty iterator	    if (weights.length == 0) 		sortedOutputs = getDestSet().iterator();	    //just do a simple linear insert over the dests	    //only has to be done once	    Vector sorted = new Vector();	    Iterator dests = getDestSet().iterator();	    //add one element	    sorted.add(dests.next());	    while (dests.hasNext()) {		InputTraceNode current = (InputTraceNode)dests.next();		for (int i = 0; i < sorted.size(); i++) {		    //if this is the correct place to insert it, 		    //add it and break		    if (getWeight(current) > 			getWeight((InputTraceNode)sorted.get(i))) {			sorted.add(i, current);			break;		    }		    		}	    }	    sortedOutputs = sorted.iterator();	}	return sortedOutputs;    }