|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectse.sics.prologbeans.Bindings
se.sics.prologbeans.QueryAnswer
public class QueryAnswer
QueryAnswer
is the Java
representation of an answer from the Prolog server. The
QueryAnswer
is returned by
PrologSession
in response to a query and contains
variable bindings, errors, and success/failure information. It also contains
the variable bindings specified in the query.
Constructor Summary | |
---|---|
QueryAnswer(PBTerm answer,
Bindings bindings)
Creates a new QueryAnswer instance with the specified
information. |
Method Summary | |
---|---|
java.lang.String |
getError()
Returns the error reason or null if an error has not
occurred or if no error reason is known. |
PBTerm |
getValue(java.lang.String variable)
Returns the value of the specified variable or null if the
variable is not bound. |
boolean |
isError()
Returns true if an error occurred while processing the query
and false otherwise. |
boolean |
queryFailed()
Returns true if the query failed (i.e. the Prolog responded
with 'no') and false otherwise. |
java.lang.String |
toString()
Returns a string description of this answer. |
Methods inherited from class se.sics.prologbeans.Bindings |
---|
bind, bind, bind, bind, bind, bind, bindAtom |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public QueryAnswer(PBTerm answer, Bindings bindings)
QueryAnswer
instance with the specified
information.
answer
- a PBTerm
value representing the
Prolog responsebindings
- the variable bindings for the query to which this is an answerMethod Detail |
---|
public PBTerm getValue(java.lang.String variable)
null
if the
variable is not bound.
getValue
in class Bindings
variable
- the name of the variable
PBTerm
or null
if the variable is not boundpublic boolean queryFailed()
true
if the query failed (i.e. the Prolog responded
with 'no') and false
otherwise.
public boolean isError()
true
if an error occurred while processing the query
and false
otherwise.
public java.lang.String getError()
null
if an error has not
occurred or if no error reason is known.
public java.lang.String toString()
toString
in class Bindings
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |