tools.jinniengineanswer
Class JinniEngineAnswer

java.lang.Object
  extended by tools.jinniengineanswer.JinniEngineAnswer
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable

public class JinniEngineAnswer
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

This is an answer object used to check out an answer given by the JinnIde server which allows one using the JinnIde server as validation system or framework. It basically serves to find true or false anwers through the isValid method. More detailed answers are still simply dealt with using the getAnswer method which just returns the answer of Jinni as a String

Version:
Cassandra
Author:
Wolfgang Chico Toepfer
See Also:
Serialized Form

Constructor Summary
JinniEngineAnswer()
           
 
Method Summary
 java.lang.Object clone()
           
 java.lang.String getAnswer()
          This is for a more general application where more than just a true or false is needed as output information.
 boolean isValid()
          This is a pure validation means and allows asking the validity, in other words the truth value of the query related to this answer object
 void setAnswer(java.lang.String anAnswer)
          Sets the query response; should only be used on the pure Prolog Jinni side
 void setException(JinniEngineException ex)
          Sets the Java exception as an equivalent of the Jinni Prolog exception that has been thrown on the Jinni Prolog side; is only used on the pure Prolog Jinni side
 void setValid(java.lang.String booleanValue)
          Sets the truth value of the query response; should only be used on the pure Prolog Jinni side
 java.lang.String tellValid()
          same as isValid except for it returning String versions of the truth value to make it easy to check from within Jinni
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JinniEngineAnswer

public JinniEngineAnswer()
Method Detail

getAnswer

public java.lang.String getAnswer()
                           throws JinniEngineException
This is for a more general application where more than just a true or false is needed as output information. Still it is a simple answer as no support for evaluating single logic variables is given which might be next though..

Returns:
contains the query response of Jinni which is related to the query of this answer object
Throws:
JinniEngineException

isValid

public boolean isValid()
                throws JinniEngineException
This is a pure validation means and allows asking the validity, in other words the truth value of the query related to this answer object

Returns:
true iff the related query is true
Throws:
JinniEngineException - when an exception was thrown at the time the related query was asked which is usually a child of JinniEngineException that identifies the occurred, more specific exception

tellValid

public java.lang.String tellValid()
                           throws JinniEngineException
same as isValid except for it returning String versions of the truth value to make it easy to check from within Jinni

Returns:
true iff the related query is true
Throws:
JinniEngineException - when an exception was thrown at the time the related query was asked which is usually a child of JinniEngineException that identifies the occurred, more specific exception

setAnswer

public void setAnswer(java.lang.String anAnswer)
Sets the query response; should only be used on the pure Prolog Jinni side

Parameters:
anAnswer - query response of Jinni

setValid

public void setValid(java.lang.String booleanValue)
Sets the truth value of the query response; should only be used on the pure Prolog Jinni side

Parameters:
booleanValue - the truth value to be set

setException

public void setException(JinniEngineException ex)
Sets the Java exception as an equivalent of the Jinni Prolog exception that has been thrown on the Jinni Prolog side; is only used on the pure Prolog Jinni side

Parameters:
ex - the exception to be set usually a sub class instance of JinniEngineException

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object