while (!categoryPolicyNameIterator.hasNext() &&
categoryElementIterator.hasNext()) {
try {
moveToNextCategory();
} catch (RepositoryException e) {
throw new UndeclaredThrowableException(e);
}
}
return categoryPolicyNameIterator.hasNext();
}
/**
* Get the next policy name.
* @return the policy name
*/
public Object next() {
// Move to next category if current category is "exhausted" and
// there is a next category, or move to the first category.
if (!categoryPolicyNameIterator.hasNext() &&
categoryElementIterator.hasNext()) {
try {
moveToNextCategory();
} catch (RepositoryException e) {
throw new UndeclaredThrowableException(e);
}
}
// Gets the next policy name, or throws a
// NoSuchElementException if there is no next policy name.
String policyName = (String) categoryPolicyNameIterator.next();