public abstract class ReconExpression
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
TOKEN_CONSTANT |
static int |
TOKEN_DATASET1_FIELD |
static int |
TOKEN_DATASET2_FIELD |
static int |
TOKEN_HIGHEST_VALUE
the highest numerical value of the tag that a valid expression token can have
|
static int |
TOKEN_INVALID |
static int |
TOKEN_LEFT_PARENTHESIS |
static int |
TOKEN_LOWEST_VALUE
the lowest numerical value the tag that a valid expression token can have
|
static int |
TOKEN_OPERATOR |
static int |
TOKEN_RIGHT_PARENTHESIS |
static int |
TOKEN_VALUE
a value to compare against in an expression
|
java.util.List<ReconOperator> |
validOperators
the allowed operators
|
Constructor and Description |
---|
ReconExpression(ReconInfo reconInfo) |
Modifier and Type | Method and Description |
---|---|
void |
addExpressionToken(int tokenType,
java.lang.String tokenValue)
Append a token at the end of the expresion.
|
void |
addExpressionToken(int tokenType,
java.lang.String tokenValue,
java.lang.String tokenUnit)
Append a token at the end of the expresion.
|
java.util.Set |
getAttributeSet(boolean getLeftSide,
boolean stripPrefixes) |
java.util.Map |
getAttributeToUnitMap(boolean getLeftSide,
boolean stripPrefixes) |
java.lang.String |
getCompiledExpressionAsString() |
java.lang.String |
getExpressionTag() |
void |
prepareAttributeIndexes(ReconValueSet leadingSet,
ReconValueSet subordinateSet)
Modifies the comparison operators to use indexes into the attribute arrays
instead of attribute names - done for performance reasons
|
static void |
processInfixExpression(java.util.Stack operatorStack,
java.util.Stack nodeStack,
ReconExpressionToken currentToken) |
static void |
processOperatorToken(java.util.Stack operatorStack,
java.util.Stack nodeStack,
ReconExpressionToken currentToken) |
static void |
processRightParenthesisToken(java.util.Stack operatorStack,
java.util.Stack nodeStack) |
void |
readExpression(MboSetRemote reconLinkSet)
The reason why this method exisits: It is not possible to sort the MBO set
itself, because this code is called to validate the rule.
|
void |
reset()
Start over
|
void |
setExpressionTag(java.lang.String expressionTag) |
public static final int TOKEN_INVALID
public static final int TOKEN_LEFT_PARENTHESIS
public static final int TOKEN_RIGHT_PARENTHESIS
public static final int TOKEN_OPERATOR
public static final int TOKEN_CONSTANT
public static final int TOKEN_DATASET1_FIELD
public static final int TOKEN_DATASET2_FIELD
public static final int TOKEN_VALUE
public static final int TOKEN_LOWEST_VALUE
public static final int TOKEN_HIGHEST_VALUE
public java.util.List<ReconOperator> validOperators
public ReconExpression(ReconInfo reconInfo)
public void setExpressionTag(java.lang.String expressionTag)
public java.lang.String getExpressionTag()
public java.lang.String getCompiledExpressionAsString()
public void addExpressionToken(int tokenType, java.lang.String tokenValue) throws MXException
MXException
public void addExpressionToken(int tokenType, java.lang.String tokenValue, java.lang.String tokenUnit) throws MXException
MXException
public void prepareAttributeIndexes(ReconValueSet leadingSet, ReconValueSet subordinateSet) throws MXException
leadingSet
- subordinateSet
- MXException
public void readExpression(MboSetRemote reconLinkSet) throws MXException, java.rmi.RemoteException
MXException
java.rmi.RemoteException
public void reset()
public static void processOperatorToken(java.util.Stack operatorStack, java.util.Stack nodeStack, ReconExpressionToken currentToken) throws MXException
operatorStack
- stack containing operators found so farnodeStack
- resulting stack where each object is a
BinaryTreeNodecurrentToken
- the current token expression being processedMXException
for processing step #'s.
2) Token is an operator:
a) pop all operators that have equal or higher precedence from the
operator stack
b) push operators onto result stack
c) push current operator onto the operator stack
public static void processRightParenthesisToken(java.util.Stack operatorStack, java.util.Stack nodeStack)
operatorStack
- stack containing operators found so farnodeStack
- resulting stack where each object is a
BinaryTreeNodefor processing step #'s.
4) Token is right parenthesis:
a) Pop all operators from operator stack.
b) Push onto resulting stack, until a matching left parenthesis found
- do not include the pair of matching parentheses
public static void processInfixExpression(java.util.Stack operatorStack, java.util.Stack nodeStack, ReconExpressionToken currentToken) throws MXException
operatorStack
- stack containing operators found so farnodeStack
- resulting stack where each object is a
BinaryTreeNodecurrentToken
- the current token expression being processedMXException
for processing step #'s.
public java.util.Set getAttributeSet(boolean getLeftSide, boolean stripPrefixes)
getLeftSide
- stripPrefixes
- public java.util.Map getAttributeToUnitMap(boolean getLeftSide, boolean stripPrefixes)
getLeftSide
- stripPrefixes
-