public class Answer
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private boolean |
answerBoolean
The answer of the query if it can be represented
as true or false
|
private java.lang.Double |
answerDouble
The answer of the query if it can be represented
as a number
|
private BeliefBase |
beliefBase
The knowledge base of the original query.
|
private Formula |
query
The original query for this answer.
|
private java.lang.String |
text
A textual description of the answer to the query.
|
Constructor and Description |
---|
Answer(BeliefBase beliefBase,
Formula query)
Creates an empty answer for the given query.
|
Modifier and Type | Method and Description |
---|---|
void |
appendText(java.lang.String text)
Appends the given text to this answer's text.
|
boolean |
getAnswerBoolean()
Returns the boolean form of this answer.
|
java.lang.Double |
getAnswerDouble()
Returns the double form of this answer.
|
BeliefBase |
getKnowledgeBase()
Returns the knowledge base this answer relates to.
|
Formula |
getQuery()
Returns the query this answer relates to.
|
java.lang.String |
getText()
Returns the textual description of this answer.
|
void |
setAnswer(boolean answer)
The answer of the query in boolean form.
|
void |
setAnswer(java.lang.Double answer)
The answer of the query in boolean form.
|
java.lang.String |
toString() |
private Formula query
private boolean answerBoolean
private java.lang.Double answerDouble
private BeliefBase beliefBase
private java.lang.String text
public Answer(BeliefBase beliefBase, Formula query)
query
- a query.public void appendText(java.lang.String text)
text
- a string.public void setAnswer(boolean answer)
answer
- a booleanpublic void setAnswer(java.lang.Double answer)
answer
- a booleanpublic boolean getAnswerBoolean()
public java.lang.Double getAnswerDouble()
public java.lang.String getText()
public Formula getQuery()
public BeliefBase getKnowledgeBase()
public java.lang.String toString()
toString
in class java.lang.Object