Java Reference
In-Depth Information
/**
* Return true if there are no more workload units.
*
* @return Returns true if there are no more workload
* units.
* @throws WorkloadException
* Thrown if there was an error determining if
* the workload is empty.
*/
public boolean workloadEmpty() throws WorkloadException
{
RepeatableStatement.Results rs = null;
try
{
rs = this.stmtWorkloadEmpty.executeQuery(
this.currentHostID);
if (!rs.getResultSet().next())
{
return true;
}
return (rs.getResultSet().getInt(1) < 1);
} catch (SQLException e)
{
throw (new WorkloadException(e));
} finally
{
if (rs != null)
{
rs.close();
}
}
}
/**
* Compute a hash for a URL.
*
* @param url
* The URL to compute the hash for.
* @return The hash code.
*/
private int computeHash(URL url)
{
String str = url.toString().trim();
int result = str.hashCode();
Search WWH ::




Custom Search