|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object se.sics.jasper.SPQuery
public class SPQuery
This class is used for holding a query-reference which is used to find multiple solutions to a query. This class is never instantiated explicitly by the user.
You should not inherit from SPQuery
.
SICStus.openQuery(java.lang.String, java.lang.String, se.sics.jasper.SPTerm[])
Method Summary | |
---|---|
void |
close()
Closes a query. |
void |
cut()
Discards choices made since this query object was created, like the goal ! |
boolean |
nextSolution()
Gets the next solution for the query. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public boolean nextSolution() throws SPException
false
when there are no more
solutions. When no more solutions are needed, the query must be
closed using the method close()
.
Multiple queries can be open at the same time, but the calls to
nextSolution must be nested, i.e. refer to the most recently
opened query. Invalidates all SPTerm
objects
created since this query was created
Invalidates all SPTerm objects created since this query was
created If you need to keep data created by the previous call
to nextSolution
to this query (i.e. data referred
to by SPTerm
objects), you need
to convert it to Java datatypes before calling this function.
nextSolution
in interface Query
SPException
- If a Prolog exception was thrown during
the query.SICStus.openQuery(java.lang.String, java.lang.String, se.sics.jasper.SPTerm[])
,
close()
,
cut()
public void close()
openQuery
was called. If the
query is not the most recently opened, all still open queries
opened after this query will be closed as well.
A closed
or cut
query is invalidated and most
operations on it will throw an exception. In particular you
should not call close
, cut
or
nextSolution
on an invalidated query.
Invalidates all SPTerm objects created since this
query was created
If you need to keep data created by the query (i.e. data
referred to by SPTerm
objects),
you need to convert it to Java datatypes before calling this
function.
close
in interface Query
public void cut() throws SPException
!
.
If the query is not the most recently opened, all still open queries opened after this query will be cut as well.
A closed
or cut
query is invalidated and most
operations on it will throw an exception. In particular you
should not call close
, cut
or
nextSolution
on an invalidated query.
Invalidates all SPTerm objects created since this
query was created
If you need to keep data created by the query (i.e. data
referred to by SPTerm
objects),
you need to convert it to Java datatypes before calling this
function.
cut
in interface Query
SPException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |