se.sics.prologbeans
Class QueryAnswer

QueryAnswer is the .NET representation of an answer from the Prolog server. The QueryAnswer is returned by se.sics.prologbeans.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(se.sics.prologbeans.Term answer, se.sics.prologbeans.Bindings bindings)
         Creates a new QueryAnswer instance with the specified information.

Property Summary
string Error
         Returns the error reason or null if an error has not occurred or if no error reason is known.
bool IsError
         Returns true if an error occurred while processing the query and false otherwise.

Method Summary
se.sics.prologbeans.Term getValue(string variable)
         Returns the value of the specified variable or null if the variable is not bound.
bool queryFailed()
         Returns true if the query failed (i.e. the Prolog responded with 'no') and false otherwise.
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 System.Object
Equals, Finalize, GetHashCode, GetType, MemberwiseClone


Constructor Detail

QueryAnswer

public QueryAnswer(se.sics.prologbeans.Term answer,
                   se.sics.prologbeans.Bindings bindings)

Creates a new QueryAnswer instance with the specified information.

Parameters:
answer - a Term value representing the Prolog response
bindings - the variable bindings for the query to which this is an answer
Property Detail

Error

public string Error

Returns the error reason or null if an error has not occurred or if no error reason is known.


IsError

public bool IsError

Returns true if an error occurred while processing the query and false otherwise.

Method Detail

getValue

public se.sics.prologbeans.Term getValue(string variable)

Returns the value of the specified variable or null if the variable is not bound.

Parameters:
variable - the name of the variable
Returns:
the value of the variable as a Term or null if the variable is not bound

queryFailed

public bool queryFailed()

Returns true if the query failed (i.e. the Prolog responded with 'no') and false otherwise.


ToString

public string ToString()

Returns a string description of this answer.