MCPcopy Create free account
hub / github.com/SWI-Prolog/packages-jpl / hasMoreSolutions

Method hasMoreSolutions

src/main/java/org/jpl7/Query.java:339–345  ·  view source on GitHub ↗

This method returns true if JPL was able to initiate a "call" of this Query within a Prolog engine. It is designed to be used with the nextSolution() method to retrieve one or more substitutions in the form of Maps. To iterate through all the solutions to a Query, for example, one might write

()

Source from the content-addressed store, hash-verified

337 * @return true if the Prolog query succeeds; otherwise false.
338 */
339 public final boolean hasMoreSolutions() {
340 if (hasNextSolution == null) {
341 if (!open) open();
342 hasNextSolution = fetchNextSolution();
343 }
344 return hasNextSolution;
345 }
346
347 /**
348 * This method returns true if JPL was able to initiate a "call" of this

Callers 15

testGetSolution1Method · 0.95
testGetSolution1bMethod · 0.95
testOpenGetClose1Method · 0.95
testStackedQueries1Method · 0.95
ReportPrologFlagsMethod · 0.95
runMethod · 0.95
hasNextMethod · 0.95
hasMoreElementsMethod · 0.95
nextSolutionMethod · 0.95
nSolutionsMethod · 0.95
oneSolutionMethod · 0.95
textToTermMethod · 0.95

Calls 2

openMethod · 0.95
fetchNextSolutionMethod · 0.95

Tested by 7

testGetSolution1Method · 0.76
testGetSolution1bMethod · 0.76
testOpenGetClose1Method · 0.76
testStackedQueries1Method · 0.76
ReportPrologFlagsMethod · 0.76
runMethod · 0.76
runMethod · 0.76