| java.lang.Object com.xoetrope.survey.DefaultRule
All known Subclasses: com.xoetrope.carousel.survey.XRule,
DefaultRule | public class DefaultRule (Code) | | DefaultRule is a set of conditions being used by the DefaultRuleEngine.
Copyright (c) Xoetrope Ltd., 2001-2006, This software is licensed under
the GNU Public License (GPL), please see license.txt for more details. If
you make commercial use of this software you must purchase a commercial
license from Xoetrope.
$Revision: 1.5 $
|
DefaultRule | public DefaultRule(int i, QuestionGroup g, String n)(Code) | | Creates a new instance of the DefaultRule
Parameters: i - the if of the rule Parameters: g - question group that this rule belongs to Parameters: n - the name of the rule |
DefaultRule | public DefaultRule(int i, QuestionGroup g, QuestionGroup t, String n)(Code) | | Creates a new instance of the default rule.
Parameters: i - the id of this rule Parameters: g - question group that this rule belongs to Parameters: t - question group that this rule leads to |
addCondition | public Condition addCondition(Question question, Option option, String answer)(Code) | | Creates and sdds the new condition to this rule
Parameters: question - the question of the conditionwhich is to be added Parameters: option - the option, the answer for whichis specified Parameters: answer - answer for the option the new condition |
checkResponses | public int checkResponses(Vector userResponses)(Code) | | Check whether specified users responses match the conditions
contained in this rule.
Parameters: userResponses - responses given by the user id of the target questions group if the responses match, -1 otherwise |
getCondition | public Condition getCondition(Question question)(Code) | | Gets the condition for the specified question.
Parameters: question - question whose condition is tobe obtained condition for the specified question. |
getConditions | public Vector getConditions()(Code) | | Gets the conditions being contained by this rule
Vector containing conditions |
getGroup | public QuestionGroup getGroup()(Code) | | Gets the question group that this rule belongs to
the question group. |
getId | public int getId()(Code) | | Gets the id of this rule
the id |
getName | public String getName()(Code) | | Gets the name of this rule
|
getTarget | public QuestionGroup getTarget()(Code) | | Gets the question group that this rule leads to
|
removeCondition | public void removeCondition(int questionId)(Code) | | Removes all conditions of the speicifed question
Parameters: questionId - the id of the question whoseconditions will be removed |
removeCondtion | public void removeCondtion(Condition condition)(Code) | | Removes the specified conditon from this rule
Parameters: condition - the condition to be removed |
setId | public void setId(int i)(Code) | | Sets the new id of this rule
Parameters: i - the new id |
setName | public void setName(String n)(Code) | | Sets the name of this rule
Parameters: n - the new name of this rule |
setTarget | public void setTarget(QuestionGroup at)(Code) | | Sets the new question group that this
rule will lead to.
Parameters: the - new question group. |
|
|