/** * Generates the next element in the search. * * @return The next solution from the search if one is available, or <tt>null</tt> if the search is * complete. */ public T nextInSequence() { try { return search.search(); } catch (SearchNotExhaustiveException e) { // SearchNotExhaustiveException means that the search has completed within its designed parameters // without exhausting the search space. Consequently there are no more solutions to find, // the exception can be ignored and the sequence correctly terminated. e = null; return null; } } };
/** * Generates the next element in the search. * * @return The next solution from the search if one is available, or <tt>null</tt> if the search is * complete. */ public T nextInSequence() { try { return search.search(); } catch (SearchNotExhaustiveException e) { // SearchNotExhaustiveException means that the search has completed within its designed parameters // without exhausting the search space. Consequently there are no more solutions to find, // the exception can be ignored and the sequence correctly terminated. e = null; return null; } } };