|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Dictionary
java.util.Hashtable
fr.lifl.magique.util.QuestionTable
such a table associates a question name (String) with an AnswerVector object. So an Agent can know when the answer to a question has arrived and what it is, and multiple answer can be managed.
AnswerVector
,
Serialized FormConstructor Summary | |
QuestionTable()
|
|
QuestionTable(ConcurrencyPolicy theConcurrencyPolicy)
|
Method Summary | |
AnswerVector |
getAnswerVector(java.lang.String question)
give the answer vector associated to the question |
Answer |
getTheAnswer(java.lang.String question)
give the answer to the question (this may have been selected among multiple answers) |
boolean |
isAnswerReceived(java.lang.String question)
tells if the answer to the question has been received |
void |
newQuestion(Request question)
add a question to the table |
void |
removeQuestion(java.lang.String question)
remove a question entry from the table |
Answer |
selectTheAnswer(java.lang.String question)
give the answer to the question (this may have been selected among multiple answers if question was aconcurrent one) |
void |
setAnAnswer(java.lang.String question,
java.lang.Object answer,
java.lang.String answerer,
int pathLength)
an answer to question has been received, this method adds it to the vector of answer associated to the question |
void |
setConcurrencyPolicy(ConcurrencyPolicy theConcurrencyPolicy)
set the concurrency policy |
Methods inherited from class java.util.Hashtable |
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public QuestionTable()
public QuestionTable(ConcurrencyPolicy theConcurrencyPolicy)
Method Detail |
public void setConcurrencyPolicy(ConcurrencyPolicy theConcurrencyPolicy)
public void newQuestion(Request question)
question
- the question to addpublic AnswerVector getAnswerVector(java.lang.String question)
question
- the question you want the answer to
public Answer getTheAnswer(java.lang.String question)
question
- the question you want the answer to
public boolean isAnswerReceived(java.lang.String question)
question
- the question you want to test
public Answer selectTheAnswer(java.lang.String question)
question
- the question you want the answer to
public void setAnAnswer(java.lang.String question, java.lang.Object answer, java.lang.String answerer, int pathLength)
question
- the question that has been answeredanswer
- the value of the answer to questionanswerer
- the full name of the agent who answered to questionpathLength
- the length of the path to reach the answerer
public void removeQuestion(java.lang.String question)
question
- the question to remove
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |