Java Reference
In-Depth Information
* @param depth
* The depth of this URL.
* @return True if the URL was added, false otherwise.
* @throws WorkloadException If any error occurs.
*/
public boolean add(URL url, URL source, int depth) {
if (!contains(url)) {
this.waiting.add(url);
setStatus(url, source, URLStatus.Status.WAITING, depth);
if (this.currentHost == null) {
this.currentHost = url.getHost().toLowerCase();
}
return true;
}
return false;
}
/**
* Clear the workload.
*
* @throws WorkloadException
* An error prevented the workload from being
* cleared.
*/
public void clear() {
this.workload.clear();
this.waiting.clear();
this.workingCount = 0;
}
/**
* Determine if the workload contains the specified URL.
*
* @param url
* @return
* @throws WorkloadException
*/
public boolean contains(URL url) {
return (this.workload.containsKey(url));
}
/**
* Convert the specified String to a URL. If the string is
* too long or has other issues, throw a
* WorkloadException.
Search WWH ::




Custom Search