public Iterator<BasicBlock> successorIterator(BasicBlock block) { TreeSet<BasicBlock> successorSet = new TreeSet<BasicBlock>(); Iterator<Edge> ei = outgoingEdgeIterator(block); while (ei.hasNext()) { successorSet.add(ei.next().getDest());
public Iterator<BasicBlock> successorIterator(final BasicBlock block) { return new Iterator<BasicBlock>() { private Iterator<Edge> iter = outgoingEdgeIterator(block); public boolean hasNext() { return iter.hasNext(); } public BasicBlock next() { return iter.next().getDest(); } public void remove() { throw new UnsupportedOperationException(); } };
    public Iterator<BasicBlock> successorIterator(BasicBlock block) {	TreeSet<BasicBlock> successorSet = new TreeSet<BasicBlock>();	Iterator<Edge> ei = outgoingEdgeIterator(block);	while (ei.hasNext()) {	    successorSet.add(ei.next().getDest());	}	return successorSet.iterator();    }