return parser;
}
public Image nextImage()
{
Image image = null;
if(iterator.hasNext())
{
Element el = iterator.next();
String url = el.attr("src");
if(url != null && url.trim().length() > 0
&& url.matches(IMG_SUFFIX_PATTERN) && !urls.contains(url))
{
image = new Image();
int suffixIndex = url.lastIndexOf('.') + 1;
int nameIndex = url.lastIndexOf('/') + 1;
image.setName(url.substring(nameIndex));
image.setExtension(url.substring(suffixIndex));
url = url.matches(IMG_URL_PREFIX) ? url : (this.url + url);
image.setUrl(url);
urls.add(url);
}
}
return image;