|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.kuali.student.common.messagebuilder.impl.SimpleBooleanMessageBuilder
public class SimpleBooleanMessageBuilder
This class creates success messages for boolean binary tree nodes. Default display is a single line message (e.g. A OR (B AND (C OR D))). To display as multiple lines where each operator and message is on its own line. set the following:
INDENT_CHAR = ' ' INDENT_NUMBER_OF_SPACES = 4 BOOLEAN_OPERATOR_PREFIX = "\n" BOOLEAN_OPERATOR_SUFFIX = "\n" Example:
MATH101
OR
(MATH201
AND
(MATH301
OR
MATH401))
| Field Summary | |
|---|---|
private static String |
BOOLEAN_OPERATOR_PREFIX
|
private static String |
BOOLEAN_OPERATOR_SUFFIX
|
private String |
booleanOperatorPrefix
|
private BooleanOperators |
booleanOperators
Boolean operators to use in creating the success message |
private String |
booleanOperatorSuffix
|
private static char |
INDENT_CHAR
|
private static int |
INDENT_NUMBER_OF_SPACES
|
private static String |
INDENT_STRING
|
private int |
indentCharacter
|
private int |
indentNumberOfSpaces
|
private String |
indentString
|
private int |
parentCount
|
| Constructor Summary | |
|---|---|
SimpleBooleanMessageBuilder(BooleanOperators bo)
Creates a success message builder with boolean operators to use in building the success message. |
|
SimpleBooleanMessageBuilder(String andOperator,
String orOperator)
Creates a success message builder with boolean operators to use in building the success message. |
|
| Method Summary | |
|---|---|
private void |
buildAndNodeSuccessMessage(BooleanNode node)
Builds a success message for an AND node (b-tree node) where left node and right node are true. |
String |
buildMessage(BooleanNode node)
Builds and sets the success message for a single boolean node (b-tree node). |
String |
buildMessage(List<BooleanNode> nodeList)
Builds and sets the success message for each of the boolean nodes (binary tree) in the nodeList. |
private void |
buildOrNodeSuccessMessage(BooleanNode node)
Builds a success message for an OR node (b-tree node) where left node and right node are true. |
private void |
countParents(BooleanNode node)
|
private String |
getIndent(BooleanNode node,
int multiplier)
|
private static String |
getString(int charCount,
char indentChr)
|
void |
setBooleanOperatorPrefix(String booleanOperatorPrefix)
|
void |
setBooleanOperatorSuffix(String booleanOperatorSuffix)
|
void |
setIndentCharacter(int indentChar)
|
void |
setIndentNumberOfSpaces(int indentNumberOfSpaces)
|
void |
setIndentString(String indentString)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static final char INDENT_CHAR
private static final int INDENT_NUMBER_OF_SPACES
private static final String INDENT_STRING
private static final String BOOLEAN_OPERATOR_PREFIX
private static final String BOOLEAN_OPERATOR_SUFFIX
private int indentCharacter
private int indentNumberOfSpaces
private String indentString
private String booleanOperatorPrefix
private String booleanOperatorSuffix
private BooleanOperators booleanOperators
private int parentCount
| Constructor Detail |
|---|
public SimpleBooleanMessageBuilder(String andOperator,
String orOperator)
andOperator - AND logical operatororOperator - OR logical operatorpublic SimpleBooleanMessageBuilder(BooleanOperators bo)
bo - Boolean operators to build success message| Method Detail |
|---|
public void setIndentCharacter(int indentChar)
public void setIndentNumberOfSpaces(int indentNumberOfSpaces)
public void setIndentString(String indentString)
public void setBooleanOperatorPrefix(String booleanOperatorPrefix)
public void setBooleanOperatorSuffix(String booleanOperatorSuffix)
public String buildMessage(List<BooleanNode> nodeList)
throws MessageBuilderException
nodeList.
buildMessage in interface MessageTreeBuildernodeList - List of boolean nodes
MessageBuilderExceptionpublic String buildMessage(BooleanNode node)
node (b-tree node).
node - Boolean nodeprivate void buildAndNodeSuccessMessage(BooleanNode node)
node - Boolean nodeprivate void buildOrNodeSuccessMessage(BooleanNode node)
node - private void countParents(BooleanNode node)
private String getIndent(BooleanNode node,
int multiplier)
private static String getString(int charCount,
char indentChr)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||