|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.gusdb.wdk.model.BooleanQuestionNode
public class BooleanQuestionNode
Represents a Question in boolean context. A boolean Question is defined as such by having a BooleanQuery as its Query. Can take one of two forms: 1. Representing a boolean Question and its two boolean operand Questions. The operands can also be boolean Questions so using this class one can create a large tree of recursive boolean Questions. 2. Representing a normal Question that is not itself boolean but is the operand for its parent boolean Question. This is a leaf Question in a boolean Question tree and its pointers to boolean operands are null values. Also recursively sets operand Answers as parameter values for boolean Questions. Created: Fri 22 October 12:00:00 2004 EST
| Constructor Summary | |
|---|---|
BooleanQuestionNode(Question q,
BooleanQuestionNode parent)
Constructor for a BooleanQuestionNode representing a leaf in a boolean Query tree containing a Question that is not boolean. |
|
BooleanQuestionNode(Question q,
BooleanQuestionNode firstChild,
BooleanQuestionNode secondChild,
BooleanQuestionNode parent)
Constructor for a BooleanQuestionNode representing a boolean Question. |
|
| Method Summary | |
|---|---|
static BooleanQuestionNode |
combine(BooleanQuestionNode firstChild,
BooleanQuestionNode secondChild,
java.lang.String operator,
WdkModel model,
java.util.Map<java.lang.String,java.lang.String> operatorMap)
|
BooleanQuestionNode |
find(java.lang.String nodeId)
Recursive method to find a node in the tree. |
BooleanQuestionNode |
getFirstChild()
|
BooleanQuestionNode |
getParent()
|
Question |
getQuestion()
|
BooleanQuestionNode |
getSecondChild()
|
java.lang.String |
getType()
The type of a BooleanQuestionNode is defined as the
RecordClassSet name of the RecordClass. |
java.util.Hashtable |
getValues()
|
BooleanQuestionNode |
grow(BooleanQuestionNode newSecondChild,
java.lang.String operator,
WdkModel model,
java.util.Map<java.lang.String,java.lang.String> operatorMap)
This method can only be performed on a leaf node and assumes that none of the nodes in the tree has had any parameter values set yet. |
boolean |
isFirstChild()
|
boolean |
isLeaf()
|
boolean |
isRoot()
A BooleanQuestionNode is root if and only if the parent of
it is null |
Answer |
makeAnswer(int startIndex,
int endIndex)
Recursive method that traverses bqn and sets its values,
which may be either normal query values if the node is a leaf or the
Answers of its operands if the node is a boolean Question. |
void |
setValues(java.util.Hashtable values)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BooleanQuestionNode(Question q,
BooleanQuestionNode firstChild,
BooleanQuestionNode secondChild,
BooleanQuestionNode parent)
public BooleanQuestionNode(Question q,
BooleanQuestionNode parent)
parent - If the supplied parent is null; that implies that this node
represents a single-node tree.| Method Detail |
|---|
public Question getQuestion()
public BooleanQuestionNode getFirstChild()
public BooleanQuestionNode getSecondChild()
public BooleanQuestionNode getParent()
public boolean isFirstChild()
public BooleanQuestionNode grow(BooleanQuestionNode newSecondChild,
java.lang.String operator,
WdkModel model,
java.util.Map<java.lang.String,java.lang.String> operatorMap)
throws WdkModelException,
WdkUserException
WdkUserException
WdkModelException
public static BooleanQuestionNode combine(BooleanQuestionNode firstChild,
BooleanQuestionNode secondChild,
java.lang.String operator,
WdkModel model,
java.util.Map<java.lang.String,java.lang.String> operatorMap)
throws WdkModelException,
WdkUserException
WdkModelException
WdkUserException
public BooleanQuestionNode find(java.lang.String nodeId)
throws WdkModelException
nodeId - Binary number representing path to take to find node. The
number is read left to right. A 1 in the number will traverse to
the left child and a 0 in the number will traverse to the right.
When the end of the number is reached, the current node is
returned.
WdkModelException
public Answer makeAnswer(int startIndex,
int endIndex)
throws WdkUserException,
WdkModelException
bqn and sets its values,
which may be either normal query values if the node is a leaf or the
Answers of its operands if the node is a boolean Question. The method is
recursively called on each of the operands if the node is a boolean
Question.
bqn. The answer should not be used
as the answer returned by the top (recursive initializer) node;
that should be retrieved by calling makeAnswer() on that node's
Question after running this method.
WdkUserException
WdkModelExceptionpublic boolean isLeaf()
public void setValues(java.util.Hashtable values)
public java.util.Hashtable getValues()
public java.lang.String getType()
BooleanQuestionNode is defined as the
RecordClassSet name of the RecordClass.
The type is used when combining two BooleanQuestionNode,
and only nodes of the same type can be combined together.
public boolean isRoot()
BooleanQuestionNode is root if and only if the parent of
it is null
BooleanQuestionNode is root.public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||