stop=true
当内部 for 循环中达到条件时,我想打破外部 while循环。这可能吗?
urlsToScrape.addAll(startUrls);
boolean stop=false;
while(stop==false){
for(Link url:urlsToScrape){
p.rint(url.depth+" >= "+depth);
if(url.depth>=depth){
p.rint("STOP!");
stop=true;
break;
}
p.rint("scrape(): "+url.link+" / "+url.depth);
processLinks(url.link,url.depth);
urlsToScrape.remove(url);
scrapedUrls.add(url);
}
}