1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_201) on Tue Jun 16 07:41:33 AEST 2020 -->
<title>Query</title>
<meta name="date" content="2020-06-16">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Query";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":9,"i2":9,"i3":9,"i4":10,"i5":10,"i6":10,"i7":42,"i8":42,"i9":42,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":9,"i16":9,"i17":9,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":9,"i25":9,"i26":9,"i27":10,"i28":9,"i29":9,"i30":9,"i31":10,"i32":10,"i33":10,"i34":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../org/jpl7/PrologException.html" title="class in org.jpl7"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../org/jpl7/Rational.html" title="class in org.jpl7"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?org/jpl7/Query.html" target="_top">Frames</a></li>
<li><a href="Query.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#field.summary">Field</a> | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field.detail">Field</a> | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.jpl7</div>
<h2 title="Class Query" class="title">Class Query</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.jpl7.Query</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd>java.lang.Iterable<java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>>, java.util.Iterator<java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>></dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">Query</span>
extends java.lang.Object
implements java.lang.Iterable<java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>>, java.util.Iterator<java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>></pre>
<div class="block">A Query instance is created by an application in order to query the Prolog
database (or to invoke a built-in predicate). It is initialised with a
Compound (or Atom) denoting the goal which is to be called, and also contains
assorted private state relating to solutions. In some future version, it may
contain details of the module in which the goal is to be called.
<p>
A Query is either open or closed: when closed, it has no connection to the
Prolog system; when open, it is linked to an active goal within a Prolog
engine.
<p>
The Query class implements the Enumeration interface, through which one can
obtain successive solutions. The Enumeration hasMoreElements() method returns
true if the call or redo succeeded (otherwise false), and if the call or redo
did succeed, the nextElement() method returns a Map representing variable
bindings; the elements in the Map are Terms, indexed by the (String) names of
the Variables with which they are associated. For example, if <i>p(a)</i> and
<i>p(b)</i> are facts in the Prolog database, then the following is
equivalent to printing all the solutions to the Prolog query <i>p(X)</i>:
<pre>
Variable X = new Variable("X");
Term arg[] = { X };
Query q = new Query("p", arg);
while (q.hasMoreElements()) {
Term bound_to_x = ((Map) q.nextElement()).get("X");
System.out.println(bound_to_x);
}
</pre>
Make sure to close the Query (using the close() method) if you do not need
any further solutions which it may have. It is safe (although redundant) to
close a Query whose solutions are already exhausted, or which is already
closed.
To obtain just one solution from a Query, use the oneSolution() method.
To obtain all solutions, use the allSolutions() method.
To obtain at most N solutions, use the nSolutions() method.
To determine merely whether the Query is provable, use the hasSolution()
method (i.e. has at least one solution).
<hr>
Copyright (C) 2007 Paul Singleton
<p>
Copyright (C) 1998 Fred Dushin
<p>
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
<ol>
<li>Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
<li>Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
</ol>
<p>
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
<hr></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#contextModule">contextModule</a></span></code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected <a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#goal_">goal_</a></span></code>
<div class="block">the Compound or Atom (but not Dict, Float, Integer or Variable)
corresponding to the goal of this Query</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#hostModule">hostModule</a></span></code> </td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#Query-java.lang.String-">Query</a></span>(java.lang.String text)</code>
<div class="block">This constructor builds a Query from the given Prolog source text, "as is".</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#Query-java.lang.String-org.jpl7.Term-">Query</a></span>(java.lang.String text,
<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a> arg)</code> </td>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#Query-java.lang.String-org.jpl7.Term:A-">Query</a></span>(java.lang.String text,
<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>[] args)</code>
<div class="block">If text denotes an atom, this constructor is shorthand for
new Query(new Compound(name,args)).</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#Query-org.jpl7.Term-">Query</a></span>(<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a> t)</code>
<div class="block">This constructor creates a Query whose goal is the specified Term.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd"> </span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#allSolutions--">allSolutions</a></span>()</code>
<div class="block">calls the Query's goal to exhaustion and returns an array of zero or more
Maps of zero or more variablename-to-term bindings (each Map represents a
solution, in the order in which they were found).</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>static java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#allSolutions-java.lang.String-">allSolutions</a></span>(java.lang.String text)</code>
<div class="block">This static method creates a Query from the given Prolog source text
fragment, calls it to exhaustion, and returns an array of zero or more
Maps of zero or more variablename-to-term bindings (each Map represents a
solution, in the order in which they were found).</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#allSolutions-java.lang.String-org.jpl7.Term:A-">allSolutions</a></span>(java.lang.String text,
<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>[] params)</code>
<div class="block">If text denotes (in traditional Prolog source syntax) a term containing N
questionmark (?) symbols and there are N accompanying Term params, this
static method replaces each questionmark symbol by its respective param,
calls the resulting goal to exhaustion, and returns an array of zero or
more Maps of zero or more variablename-to-term bindings (each Map
represents a solution, in the order in which they were found).</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>static java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#allSolutions-org.jpl7.Term-">allSolutions</a></span>(<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a> goal)</code>
<div class="block">This static method creates a Query whose goal is the given Term, calls it
to exhaustion, and returns an array of zero or more Maps of zero or more
variablename-to-term bindings (each Map represents a solution, in the
order in which they were found).</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#close--">close</a></span>()</code>
<div class="block">This method can be used to close an open query before its solutions are
exhausted.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#getContext--">getContext</a></span>()</code>
<div class="block">Returns the context module for this Query</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#getEngine--">getEngine</a></span>()</code>
<div class="block">Returns the engine attached to this query</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#getSolution--">getSolution</a></span>()</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="block"><span class="deprecationComment">use nextSolution()</span></div>
</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#getSolutionWithVarNames--">getSolutionWithVarNames</a></span>()</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span> </div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#getSubstWithNameVars--">getSubstWithNameVars</a></span>()</code>
<div class="block"><span class="deprecatedLabel">Deprecated.</span> </div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#goal--">goal</a></span>()</code>
<div class="block">Returns the Term (Atom or Compound) which is the goal of this Query</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#hasMoreElements--">hasMoreElements</a></span>()</code>
<div class="block">This method implements part of the java.util.Enumeration interface.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#hasMoreSolutions--">hasMoreSolutions</a></span>()</code>
<div class="block">This method returns true if JPL was able to initiate a "call" of this
Query within a Prolog engine.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#hasNext--">hasNext</a></span>()</code>
<div class="block">This method is required by Iterator interface
It is a wrapper for <a href="../../org/jpl7/Query.html#hasMoreSolutions--"><code>hasMoreSolutions()</code></a></div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#hasSolution--">hasSolution</a></span>()</code>
<div class="block">This method will attempt to call this Query's goal within an available
Prolog engine.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#hasSolution-java.lang.String-">hasSolution</a></span>(java.lang.String text)</code>
<div class="block">This static method creates a Query from the given Prolog source text and
calls it at most once, returning true if a solution was found, else
false.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#hasSolution-java.lang.String-org.jpl7.Term:A-">hasSolution</a></span>(java.lang.String text,
<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>[] params)</code>
<div class="block">If text denotes (in traditional Prolog source syntax) a term containing N
questionmark (?) symbols and there are N params, each questionmark symbol
is replaced by its corresponding arg to provide the new Query's goal: the
resulting Query is called as described above.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>static boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#hasSolution-org.jpl7.Term-">hasSolution</a></span>(<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a> goal)</code>
<div class="block">This static method creates a Query (whose goal is the specified Term) and
calls it at most once, returning true if a solution was found, else
false.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#isOpen--">isOpen</a></span>()</code>
<div class="block">Whether the query is open.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>java.util.Iterator<java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#iterator--">iterator</a></span>()</code>
<div class="block">This method is required by Iterator interface
a Query is its own Iterator</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#next--">next</a></span>()</code>
<div class="block">This method is required by Iterator interface
It is a wrapper for <a href="../../org/jpl7/Query.html#nextSolution--"><code>nextSolution()</code></a></div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>java.lang.Object</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#nextElement--">nextElement</a></span>()</code>
<div class="block">This method implements part of the java.util.Enumeration interface.</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#nextSolution--">nextSolution</a></span>()</code>
<div class="block">This method returns a java.util.Map, which represents a binding from the
names of query variables to terms within the next solution.</div>
</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code>java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#nSolutions-long-">nSolutions</a></span>(long n)</code>
<div class="block">calls the Query's goal to exhaustion or until N solutions are found,
whichever is sooner, and returns an array containing (as possibly empty
Maps of variablename-to-term bindings) every found solution (in the order
in which they were found).</div>
</td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code>static java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#nSolutions-java.lang.String-long-">nSolutions</a></span>(java.lang.String text,
long n)</code>
<div class="block">This static method creates a Query from the given Prolog source text
fragment, calls it to exhaustion or until N solutions are found,
whichever is sooner, and returns an array containing (as possibly empty
Maps of variablename-to-term bindings) every found solution (in the order
in which they were found).</div>
</td>
</tr>
<tr id="i25" class="rowColor">
<td class="colFirst"><code>static java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#nSolutions-java.lang.String-org.jpl7.Term:A-long-">nSolutions</a></span>(java.lang.String text,
<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>[] params,
long n)</code>
<div class="block">If text denotes (in traditional Prolog source syntax) a term containing N
questionmark (?) symbols and there are N accompanying params, this static
method replaces each questionmark symbol by its respective param, calls
the resulting goal to exhaustion or until N solutions are found,
whichever is sooner, and returns an array containing (as possibly empty
Maps of variablename-to-term bindings) every found solution (in the order
in which they were found).</div>
</td>
</tr>
<tr id="i26" class="altColor">
<td class="colFirst"><code>static java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#nSolutions-org.jpl7.Term-long-">nSolutions</a></span>(<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a> goal,
long n)</code>
<div class="block">This static method creates a Query whose goal is the given Term, calls it
to exhaustion or until N solutions are found, whichever is sooner, and
returns an array containing (as possibly empty Maps of
variablename-to-term bindings) every found solution (in the order in
which they were found).</div>
</td>
</tr>
<tr id="i27" class="rowColor">
<td class="colFirst"><code>java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#oneSolution--">oneSolution</a></span>()</code>
<div class="block">Returns the first solution, if any, as a (possibly empty) Map of
variablename-to-term bindings, else null.</div>
</td>
</tr>
<tr id="i28" class="altColor">
<td class="colFirst"><code>static java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#oneSolution-java.lang.String-">oneSolution</a></span>(java.lang.String text)</code>
<div class="block">This static method creates a Query from the given Prolog source text
fragment, and calls it at most once, returning the first solution, if
there is one, as a (possibly empty) Map, else null.</div>
</td>
</tr>
<tr id="i29" class="rowColor">
<td class="colFirst"><code>static java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#oneSolution-java.lang.String-org.jpl7.Term:A-">oneSolution</a></span>(java.lang.String text,
<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>[] params)</code>
<div class="block">If text denotes (in traditional Prolog source syntax) a term containing N
questionmark (?) symbols and there are N params, each questionmark symbol
is replaced by its respective param to provide the goal of this query:
the resulting goal is then called (at most once) and the first solution,
if there is one, is returned as a (possibly empty) Map, else null.</div>
</td>
</tr>
<tr id="i30" class="altColor">
<td class="colFirst"><code>static java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#oneSolution-org.jpl7.Term-">oneSolution</a></span>(<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a> goal)</code>
<div class="block">This static method creates a Query (whose goal is the specified Term) and
calls it at most once, returning the first solution, if there is one, as
a (possibly empty) Map, else null.</div>
</td>
</tr>
<tr id="i31" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#open--">open</a></span>()</code>
<div class="block">This method returns true if JPL was able to initiate a "call" of this
Query within the Prolog engine.</div>
</td>
</tr>
<tr id="i32" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#remove--">remove</a></span>()</code>
<div class="block">This method (required by Iterator interface) is a no-op</div>
</td>
</tr>
<tr id="i33" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#reset--">reset</a></span>()</code>
<div class="block">Reset the query to its start: closed and no solution found so far.</div>
</td>
</tr>
<tr id="i34" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/jpl7/Query.html#toString--">toString</a></span>()</code>
<div class="block">Returns a crude String representation of a Query.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Iterable">
<!-- -->
</a>
<h3>Methods inherited from interface java.lang.Iterable</h3>
<code>forEach, spliterator</code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.util.Iterator">
<!-- -->
</a>
<h3>Methods inherited from interface java.util.Iterator</h3>
<code>forEachRemaining</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="goal_">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>goal_</h4>
<pre>protected final <a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a> goal_</pre>
<div class="block">the Compound or Atom (but not Dict, Float, Integer or Variable)
corresponding to the goal of this Query</div>
</li>
</ul>
<a name="hostModule">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hostModule</h4>
<pre>protected final java.lang.String hostModule</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../constant-values.html#org.jpl7.Query.hostModule">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="contextModule">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>contextModule</h4>
<pre>protected final java.lang.String contextModule</pre>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../constant-values.html#org.jpl7.Query.contextModule">Constant Field Values</a></dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="Query-org.jpl7.Term-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Query</h4>
<pre>public Query(<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a> t)</pre>
<div class="block">This constructor creates a Query whose goal is the specified Term. The
Query is initially closed. <b>NB</b> Creating an instance of the Query
class does not result in a call to a Prolog engine. <b>NB</b> The goal
can be a Compound or an Atom (Atom extends Compound), but cannot be an
instance of jpl.Float, jpl.Integer or jpl.Variable.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>t</code> - the goal of this Query; must be Atom or Compound</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/jpl7/JPLException.html" title="class in org.jpl7">JPLException</a></code> - if term provided is not of right sort Atom or Compound</dd>
</dl>
</li>
</ul>
<a name="Query-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Query</h4>
<pre>public Query(java.lang.String text)</pre>
<div class="block">This constructor builds a Query from the given Prolog source text, "as is".
Throws PrologException containing error(syntax_error(_),_) if text is invalid.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>text</code> - the complete Prolog source text of this Query</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/jpl7/PrologException.html" title="class in org.jpl7">PrologException</a></code> - containing error(syntax_error(_),_) if text is invalid as a term.</dd>
<dd><code><a href="../../org/jpl7/JPLException.html" title="class in org.jpl7">JPLException</a></code> - if term provided is not of right sort Atom or Compound</dd>
</dl>
</li>
</ul>
<a name="Query-java.lang.String-org.jpl7.Term:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Query</h4>
<pre>public Query(java.lang.String text,
<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>[] args)</pre>
<div class="block">If text denotes an atom, this constructor is shorthand for
new Query(new Compound(name,args)).
If text denotes a term containing N placehholder symbols ? and there are N args,
each ? is replaced by its corresponding arg to provide the new Query's goal.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>text</code> - the name of the principal functor of this Query's goal</dd>
<dd><code>args</code> - the arguments of this Query's goal</dd>
</dl>
</li>
</ul>
<a name="Query-java.lang.String-org.jpl7.Term-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Query</h4>
<pre>public Query(java.lang.String text,
<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a> arg)</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="goal--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>goal</h4>
<pre>public final <a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a> goal()</pre>
<div class="block">Returns the Term (Atom or Compound) which is the goal of this Query</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a Term representing the goal of this Query</dd>
</dl>
</li>
</ul>
<a name="getContext--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getContext</h4>
<pre>public final java.lang.String getContext()</pre>
<div class="block">Returns the context module for this Query</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a String representing the context in which the goal will be run</dd>
</dl>
</li>
</ul>
<a name="iterator--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>iterator</h4>
<pre>public java.util.Iterator<java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>> iterator()</pre>
<div class="block">This method is required by Iterator interface
a Query is its own Iterator</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>iterator</code> in interface <code>java.lang.Iterable<java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>></code></dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><code>Iterable.iterator()</code></dd>
</dl>
</li>
</ul>
<a name="hasNext--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hasNext</h4>
<pre>public boolean hasNext()</pre>
<div class="block">This method is required by Iterator interface
It is a wrapper for <a href="../../org/jpl7/Query.html#hasMoreSolutions--"><code>hasMoreSolutions()</code></a></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>hasNext</code> in interface <code>java.util.Iterator<java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>></code></dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><code>Iterator.hasNext()</code></dd>
</dl>
</li>
</ul>
<a name="next--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>next</h4>
<pre>public java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>> next()</pre>
<div class="block">This method is required by Iterator interface
It is a wrapper for <a href="../../org/jpl7/Query.html#nextSolution--"><code>nextSolution()</code></a></div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>next</code> in interface <code>java.util.Iterator<java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>></code></dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><code>Iterator.next()</code></dd>
</dl>
</li>
</ul>
<a name="remove--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>remove</h4>
<pre>public void remove()</pre>
<div class="block">This method (required by Iterator interface) is a no-op</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code>remove</code> in interface <code>java.util.Iterator<java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>></code></dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><code>Iterator.remove()</code></dd>
</dl>
</li>
</ul>
<a name="hasMoreElements--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hasMoreElements</h4>
<pre>public final boolean hasMoreElements()</pre>
<div class="block">This method implements part of the java.util.Enumeration interface.
It is a wrapper for <a href="../../org/jpl7/Query.html#hasMoreSolutions--"><code>hasMoreSolutions()</code></a>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the Prolog query yields a (or another) solution, else
false.</dd>
</dl>
</li>
</ul>
<a name="nextElement--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>nextElement</h4>
<pre>public final java.lang.Object nextElement()</pre>
<div class="block">This method implements part of the java.util.Enumeration interface.
It is a wrapper for <a href="../../org/jpl7/Query.html#nextSolution--"><code>nextSolution()</code></a>
<p></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A Map representing a substitution.</dd>
</dl>
</li>
</ul>
<a name="isOpen--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isOpen</h4>
<pre>public final boolean isOpen()</pre>
<div class="block">Whether the query is open.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the query is open, otherwise false.</dd>
</dl>
</li>
</ul>
<a name="getEngine--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getEngine</h4>
<pre>public final long getEngine()</pre>
<div class="block">Returns the engine attached to this query</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a long number representing the id of the SWI Prolog engine used in this query</dd>
</dl>
</li>
</ul>
<a name="hasMoreSolutions--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hasMoreSolutions</h4>
<pre>public final boolean hasMoreSolutions()</pre>
<div class="block">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
<pre>
Query q = // obtain Query reference
while (q.hasMoreSolutions()) {
Map solution = q.nextSolution();
// process solution...
}
</pre></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the Prolog query succeeds; otherwise false.</dd>
</dl>
</li>
</ul>
<a name="open--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>open</h4>
<pre>public final void open()</pre>
<div class="block">This method returns true if JPL was able to initiate a "call" of this
Query within the Prolog engine. It is designed to be used with the
getSolution() and close() methods to retrieve one or more substitutions
in the form of Maps.
<pre>
Query q = // obtain Query reference
Map soln;
q.open();
while ((soln = q.getSolution()) != null) {
// process solution...
}
</pre>
<p>
If this method is called on an already-open Query, or if the query cannot
be set up for whatever reason, then a JPLException will be thrown.</div>
</li>
</ul>
<a name="reset--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>reset</h4>
<pre>public final void reset()</pre>
<div class="block">Reset the query to its start: closed and no solution found so far. This will allow a query to re-start</div>
</li>
</ul>
<a name="getSolution--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSolution</h4>
<pre>@Deprecated
public final java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>> getSolution()</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span> <span class="deprecationComment">use nextSolution()</span></div>
<div class="block">Returns the next solution of the query</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the binding representing the next solution</dd>
</dl>
</li>
</ul>
<a name="getSubstWithNameVars--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSubstWithNameVars</h4>
<pre>@Deprecated
public final java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>> getSubstWithNameVars()</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span> </div>
<div class="block">Used to be used only by Utils.textToTerm but code has been integrated there already</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a substituion from variable names to terms</dd>
</dl>
</li>
</ul>
<a name="nextSolution--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>nextSolution</h4>
<pre>public final java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>> nextSolution()</pre>
<div class="block">This method returns a java.util.Map, which represents a binding from the
names of query variables to terms within the next solution.
<p>
For example, if a Query has an occurrence of a jpl.Variable, say, named
"X", one can obtain the Term bound to "X" in the solution by looking up
"X" in the Map.
<pre>
Variable x = new Variable("X");
Query q = // obtain Query reference (with x in the Term array)
while (q.hasMoreSolutions()) {
Map solution = q.nextSolution();
// make t the Term bound to "X" in the solution
Term t = (Term) solution.get("X");
// ...
}
</pre>
Programmers should be careful to call this method after checking that
there is indeed a solution, via method hasMoreSolutions().</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A Map representing a substitution of the next solution.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/jpl7/JPLException.html" title="class in org.jpl7">JPLException</a></code> - if Query is not open.</dd>
<dd><code>java.util.NoSuchElementException</code> - if there are no more new solutions.</dd>
</dl>
</li>
</ul>
<a name="getSolutionWithVarNames--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSolutionWithVarNames</h4>
<pre>@Deprecated
public final java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>> getSolutionWithVarNames()</pre>
<div class="block"><span class="deprecatedLabel">Deprecated.</span> </div>
<div class="block">Deprecated. Used to be used only in the context of Term.textToTerm() but a better solution has been
implemented there and hence does not require this difficult method anymore. Left it for reference.
This is called with query
atom_to_term(Atom, Term, Bindings) https://www.swi-prolog.org/pldoc/doc_for?object=atom_to_term/3
and we aim to return the Term version of Atom but with the name of the variables inside, not thir anonymous _
references. To do so we extract the names from Bindings and we plugged them into the Term
So, we assume the last argument of the current querry is a Binding list of the form [Name=Var,..], that is a
list containing variable names to actual Prolog variable references, like ['S'=_4518, 'P'=_4520].
E.g., atom_to_term('hello(a, X, Y)', T, B)
T = hello(a, _1, _2)
B = [ 'X' = _1, 'Y' = _2]
The whole point is to return a JPL Term but having NAMED variables, that is
returning the Compound Term hello(a, X, Y) where X and Y are JPL Variables (with names "X" and "Y")</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a Term with the variables with names</dd>
</dl>
</li>
</ul>
<a name="close--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>close</h4>
<pre>public final void close()</pre>
<div class="block">This method can be used to close an open query before its solutions are
exhausted. It is called automatically when solutions are exhausted.
Calling close() on an already closed Query has no effect.
<p>
Here is one way to get the first three solutions to a Query:
<pre>
Query q = new Query(predicate, args);
Map<String, Term> sub1 = q.nextSolution();
Map<String, Term> sub2 = q.nextSolution();
Map<String, Term> sub3 = q.nextSolution();
q.close();
</pre></div>
</li>
</ul>
<a name="allSolutions--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>allSolutions</h4>
<pre>public final java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>[] allSolutions()</pre>
<div class="block">calls the Query's goal to exhaustion and returns an array of zero or more
Maps of zero or more variablename-to-term bindings (each Map represents a
solution, in the order in which they were found).</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an array of zero or more Maps of zero or more
variablename-to-term bindings (each Map represents a solution, in
the order in which they were found) <b>NB</b> in JPL 1.0.1, this
method (inconsistently) returned null when a Query had no
solutions; in JPL 2.x onwards it returns an empty array (thus the
length of the array is, in every case, the quantity of
solutions).
<p>
<b>NB</b> in JPL 1.0.1, bindings were keyed (awkwardly) by
Variable instances; in JPL 2.x onwards they are keyed by the
(String) names of variables, which is consistent with the Term
type being just a concrete syntax for terms (and hence queries).</dd>
</dl>
</li>
</ul>
<a name="allSolutions-org.jpl7.Term-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>allSolutions</h4>
<pre>public static final java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>[] allSolutions(<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a> goal)</pre>
<div class="block">This static method creates a Query whose goal is the given Term, calls it
to exhaustion, and returns an array of zero or more Maps of zero or more
variablename-to-term bindings (each Map represents a solution, in the
order in which they were found). Throws JPLException if goal is neither a
jpl.Atom nor a jpl.Compound.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>goal</code> - the goal of this Query</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an array of zero or more Maps of zero or more
variablename-to-term bindings (each Map represents a solution, in
the order in which they were found)</dd>
</dl>
</li>
</ul>
<a name="allSolutions-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>allSolutions</h4>
<pre>public static final java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>[] allSolutions(java.lang.String text)</pre>
<div class="block">This static method creates a Query from the given Prolog source text
fragment, calls it to exhaustion, and returns an array of zero or more
Maps of zero or more variablename-to-term bindings (each Map represents a
solution, in the order in which they were found). Throws PrologException
containing error(syntax_error(_),_) if text is invalid.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>text</code> - a Prolog source text fragment denoting a goal</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an array of zero or more Maps of zero or more
variablename-to-term bindings (each Map represents a solution, in
the order in which they were found)</dd>
</dl>
</li>
</ul>
<a name="allSolutions-java.lang.String-org.jpl7.Term:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>allSolutions</h4>
<pre>public static final java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>[] allSolutions(java.lang.String text,
<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>[] params)</pre>
<div class="block">If text denotes (in traditional Prolog source syntax) a term containing N
questionmark (?) symbols and there are N accompanying Term params, this
static method replaces each questionmark symbol by its respective param,
calls the resulting goal to exhaustion, and returns an array of zero or
more Maps of zero or more variablename-to-term bindings (each Map
represents a solution, in the order in which they were found).
Otherwise, if text denotes an atom, this static method creates a Query
where text is the name of the goal and params are the args; the resulting
goal is then called as above. This letter mode is redundant, deprecated
(informally), and retained only for backward compatibility.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>text</code> - the Prolog source text of a goal, in which questionmarks are
regarded as substitutible parameters</dd>
<dd><code>params</code> - terms to be substituted for the respective questionmarks in
the query text</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an array of zero or more Maps of zero or more
variablename-to-term bindings (each Map represents a solution, in
the order in which they were found)</dd>
</dl>
</li>
</ul>
<a name="nSolutions-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>nSolutions</h4>
<pre>public final java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>[] nSolutions(long n)</pre>
<div class="block">calls the Query's goal to exhaustion or until N solutions are found,
whichever is sooner, and returns an array containing (as possibly empty
Maps of variablename-to-term bindings) every found solution (in the order
in which they were found).</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>n</code> - the number of solutions to cover</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an array of Maps (possibly none), each of which is a solution (in
the order in which they were found) of the Query; at most 'n'
solutions will be found and returned. <b>NB</b> in JPL 1.0.1,
this method (inconsistently) returned null when a Query had no
solutions; in JPL 2.x onwards it returns an empty array (thus the
length of the array is, in every case, the quantity of
solutions).
<p>
<b>NB</b> in JPL 1.0.1, bindings were keyed (awkwardly) by
Variable instances; in JPL 2.x onwards they are keyed by the
(String) names of variables, which is consistent with the Term
type being just a concrete syntax for terms (and hence queries).</dd>
</dl>
</li>
</ul>
<a name="nSolutions-org.jpl7.Term-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>nSolutions</h4>
<pre>public static final java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>[] nSolutions(<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a> goal,
long n)</pre>
<div class="block">This static method creates a Query whose goal is the given Term, calls it
to exhaustion or until N solutions are found, whichever is sooner, and
returns an array containing (as possibly empty Maps of
variablename-to-term bindings) every found solution (in the order in
which they were found). Throws JPLException if goal is neither a jpl.Atom
nor a jpl.Compound.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>goal</code> - the goal of this Query</dd>
<dd><code>n</code> - the number of solutions to cover</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an array of up to the the first n binding solutions</dd>
</dl>
</li>
</ul>
<a name="nSolutions-java.lang.String-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>nSolutions</h4>
<pre>public static final java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>[] nSolutions(java.lang.String text,
long n)</pre>
<div class="block">This static method creates a Query from the given Prolog source text
fragment, calls it to exhaustion or until N solutions are found,
whichever is sooner, and returns an array containing (as possibly empty
Maps of variablename-to-term bindings) every found solution (in the order
in which they were found). Throws PrologException containing
error(syntax_error(_),_) if text is invalid.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>text</code> - a Prolog source text fragment denoting a goal</dd>
<dd><code>n</code> - the number of solutions to cover</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an array of up to the the first n binding solutions</dd>
</dl>
</li>
</ul>
<a name="nSolutions-java.lang.String-org.jpl7.Term:A-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>nSolutions</h4>
<pre>public static final java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>>[] nSolutions(java.lang.String text,
<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>[] params,
long n)</pre>
<div class="block">If text denotes (in traditional Prolog source syntax) a term containing N
questionmark (?) symbols and there are N accompanying params, this static
method replaces each questionmark symbol by its respective param, calls
the resulting goal to exhaustion or until N solutions are found,
whichever is sooner, and returns an array containing (as possibly empty
Maps of variablename-to-term bindings) every found solution (in the order
in which they were found).
Otherwise, if text denotes an atom, this static method creates a Query
where text is the name of the goal and params are the args; the resulting
goal is then called as above. This latter mode is redundant, deprecated
(informally), and retained only for backward compatibility.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>text</code> - the Prolog source text of a goal, in which questionmarks are
regarded as substitutible parameters</dd>
<dd><code>params</code> - terms to be substituted for the respective questionmarks in
the query text</dd>
<dd><code>n</code> - the number of solutions to cover</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>an array of up to the the first n binding solutions</dd>
</dl>
</li>
</ul>
<a name="oneSolution--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>oneSolution</h4>
<pre>public final java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>> oneSolution()</pre>
<div class="block">Returns the first solution, if any, as a (possibly empty) Map of
variablename-to-term bindings, else null.
This method will throw a JPLException if this Query is already open (and
the Query will remain open as before). Otherwise, upon return, the Query
will be closed.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the first solution, if the query has one, as a (possibly empty)
Map. If the return value is null, this means that the Query has
no solutions.</dd>
</dl>
</li>
</ul>
<a name="oneSolution-org.jpl7.Term-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>oneSolution</h4>
<pre>public static final java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>> oneSolution(<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a> goal)</pre>
<div class="block">This static method creates a Query (whose goal is the specified Term) and
calls it at most once, returning the first solution, if there is one, as
a (possibly empty) Map, else null. The goal can be a jpl.Atom or a
jpl.Compound, but cannot be an instance of jpl.Float, jpl.Integer or
jpl.Variable.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>goal</code> - the goal of this Query</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>binding of the first solution</dd>
</dl>
</li>
</ul>
<a name="oneSolution-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>oneSolution</h4>
<pre>public static final java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>> oneSolution(java.lang.String text)</pre>
<div class="block">This static method creates a Query from the given Prolog source text
fragment, and calls it at most once, returning the first solution, if
there is one, as a (possibly empty) Map, else null. Throws
PrologException containing error(syntax_error(_),_) if text is invalid.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>text</code> - a Prolog source text fragment denoting a goal</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>binding of the first solution</dd>
</dl>
</li>
</ul>
<a name="oneSolution-java.lang.String-org.jpl7.Term:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>oneSolution</h4>
<pre>public static final java.util.Map<java.lang.String,<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>> oneSolution(java.lang.String text,
<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>[] params)</pre>
<div class="block">If text denotes (in traditional Prolog source syntax) a term containing N
questionmark (?) symbols and there are N params, each questionmark symbol
is replaced by its respective param to provide the goal of this query:
the resulting goal is then called (at most once) and the first solution,
if there is one, is returned as a (possibly empty) Map, else null.
Otherwise, if text denotes an atom, this static method creates a Query
where text is the name of the goal and params are the args; the resulting
goal is then called as above. This latter mode is redundant, deprecated
(informally), and retained only for backward compatibility.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>text</code> - the Prolog source text of a goal, in which questionmarks are
regarded as substitutible parameters</dd>
<dd><code>params</code> - terms to be substituted for the respective questionmarks in
the query text</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>binding of the first solution</dd>
</dl>
</li>
</ul>
<a name="hasSolution--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hasSolution</h4>
<pre>public final boolean hasSolution()</pre>
<div class="block">This method will attempt to call this Query's goal within an available
Prolog engine.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the provability of the Query, i.e. 'true' if it has at least one
solution, 'false' if the call fails without finding a solution.
<p>
Only the first solution (if there is one) will be found; any
bindings will be discarded, and the Query will be closed.
<p>
This method will throw a JPLException if this Query is already
open.</dd>
</dl>
</li>
</ul>
<a name="hasSolution-org.jpl7.Term-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hasSolution</h4>
<pre>public static final boolean hasSolution(<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a> goal)</pre>
<div class="block">This static method creates a Query (whose goal is the specified Term) and
calls it at most once, returning true if a solution was found, else
false. The goal can be a jpl.Atom or a jpl.Compound, but cannot be an
instance of jpl.Float, jpl.Integer or jpl.Variable.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>goal</code> - the goal of this Query</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true iff the query can be proved</dd>
</dl>
</li>
</ul>
<a name="hasSolution-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hasSolution</h4>
<pre>public static final boolean hasSolution(java.lang.String text)</pre>
<div class="block">This static method creates a Query from the given Prolog source text and
calls it at most once, returning true if a solution was found, else
false. Throws PrologException containing error(syntax_error(_),_) if text
is invalid.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>text</code> - the goal of this Query, as Prolog source text</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true iff the query can be proved</dd>
</dl>
</li>
</ul>
<a name="hasSolution-java.lang.String-org.jpl7.Term:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hasSolution</h4>
<pre>public static final boolean hasSolution(java.lang.String text,
<a href="../../org/jpl7/Term.html" title="class in org.jpl7">Term</a>[] params)</pre>
<div class="block">If text denotes (in traditional Prolog source syntax) a term containing N
questionmark (?) symbols and there are N params, each questionmark symbol
is replaced by its corresponding arg to provide the new Query's goal: the
resulting Query is called as described above.
Otherwise, if text denotes an atom, this static method creates a Query
where text is the name of its goal and args are its args; it then calls
this goal (at most once) and returns true if a solution was found, else
false. This latter mode is redundant, deprecated (informally), and
retained only for backward compatibility.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>text</code> - the Prolog source text of a goal, in which questionmarks are
regarded as substitutible parameters</dd>
<dd><code>params</code> - terms to be substituted for the respective questionmarks in
the query text</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true iff the query can be proved</dd>
</dl>
</li>
</ul>
<a name="toString--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>toString</h4>
<pre>public java.lang.String toString()</pre>
<div class="block">Returns a crude String representation of a Query.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code>toString</code> in class <code>java.lang.Object</code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a crude String representation of a Query</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../org/jpl7/PrologException.html" title="class in org.jpl7"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../org/jpl7/Rational.html" title="class in org.jpl7"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?org/jpl7/Query.html" target="_top">Frames</a></li>
<li><a href="Query.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li><a href="#field.summary">Field</a> | </li>
<li><a href="#constructor.summary">Constr</a> | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li><a href="#field.detail">Field</a> | </li>
<li><a href="#constructor.detail">Constr</a> | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
|