Package org.openl.rules.cmatch.algorithm
Class WeightAlgorithmCompiler
- java.lang.Object
-
- org.openl.rules.cmatch.algorithm.MatchAlgorithmCompiler
-
- org.openl.rules.cmatch.algorithm.WeightAlgorithmCompiler
-
- All Implemented Interfaces:
IMatchAlgorithmCompiler
public class WeightAlgorithmCompiler extends MatchAlgorithmCompiler
-
-
Field Summary
Fields Modifier and Type Field Description static StringROW_SCOREstatic intROW_SCORE_IDXstatic StringROW_TOTAL_SCOREstatic intROW_TOTAL_SCORE_IDXstatic StringWEIGHTprotected static List<ColumnDefinition>WEIGHT_COLUMN_DEFINITION-
Fields inherited from class org.openl.rules.cmatch.algorithm.MatchAlgorithmCompiler
MATCH_COLUMN_DEFINITION, NAMES, OPERATION, VALUES
-
-
Constructor Summary
Constructors Constructor Description WeightAlgorithmCompiler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidassignExecutor(ColumnMatch columnMatch)protected MatchNodebuildTree(List<TableRow> rows, MatchNode[] nodes)Builds tree based on indentation of each row.protected voidcheckSpecialRows(ColumnMatch columnMatch)protected List<ColumnDefinition>getColumnDefinition()protected intgetSpecialRowCount()protected voidparseSpecialRows(IBindingContext bindingContext, ColumnMatch columnMatch)Compiles (parses) return values based on return type.protected MatchNode[]prepareNodes(IBindingContext bindingContext, ColumnMatch columnMatch, ArgumentsHelper argumentsHelper, int retValuesCount)Prepares Nodes.protected voidvalidateTree(MatchNode rootNode, List<TableRow> rows, MatchNode[] nodes)Overrides to do nothing.-
Methods inherited from class org.openl.rules.cmatch.algorithm.MatchAlgorithmCompiler
checkRowName, compile, parseCheckValues, parseValues, setMetaInfoForConstant
-
-
-
-
Field Detail
-
WEIGHT
public static final String WEIGHT
- See Also:
- Constant Field Values
-
ROW_TOTAL_SCORE
public static final String ROW_TOTAL_SCORE
- See Also:
- Constant Field Values
-
ROW_SCORE
public static final String ROW_SCORE
- See Also:
- Constant Field Values
-
ROW_TOTAL_SCORE_IDX
public static final int ROW_TOTAL_SCORE_IDX
- See Also:
- Constant Field Values
-
ROW_SCORE_IDX
public static final int ROW_SCORE_IDX
- See Also:
- Constant Field Values
-
WEIGHT_COLUMN_DEFINITION
protected static final List<ColumnDefinition> WEIGHT_COLUMN_DEFINITION
-
-
Method Detail
-
assignExecutor
protected void assignExecutor(ColumnMatch columnMatch)
- Overrides:
assignExecutorin classMatchAlgorithmCompiler
-
buildTree
protected MatchNode buildTree(List<TableRow> rows, MatchNode[] nodes) throws SyntaxNodeException
Description copied from class:MatchAlgorithmCompilerBuilds tree based on indentation of each row.- Overrides:
buildTreein classMatchAlgorithmCompilernodes- (special rows must be null)- Returns:
- root of tree
- Throws:
SyntaxNodeException
-
checkSpecialRows
protected void checkSpecialRows(ColumnMatch columnMatch) throws SyntaxNodeException
- Overrides:
checkSpecialRowsin classMatchAlgorithmCompiler- Throws:
SyntaxNodeException
-
getColumnDefinition
protected List<ColumnDefinition> getColumnDefinition()
- Overrides:
getColumnDefinitionin classMatchAlgorithmCompiler
-
getSpecialRowCount
protected int getSpecialRowCount()
- Overrides:
getSpecialRowCountin classMatchAlgorithmCompiler
-
parseSpecialRows
protected void parseSpecialRows(IBindingContext bindingContext, ColumnMatch columnMatch) throws SyntaxNodeException
Description copied from class:MatchAlgorithmCompilerCompiles (parses) return values based on return type.- Overrides:
parseSpecialRowsin classMatchAlgorithmCompiler- Throws:
SyntaxNodeException
-
prepareNodes
protected MatchNode[] prepareNodes(IBindingContext bindingContext, ColumnMatch columnMatch, ArgumentsHelper argumentsHelper, int retValuesCount) throws SyntaxNodeException
Description copied from class:MatchAlgorithmCompilerPrepares Nodes. Check names, operations and assigns matchers.Special rows are ignored. That is why first n elements in return array is always null.
- Overrides:
prepareNodesin classMatchAlgorithmCompiler- Returns:
- array of nodes, elements corresponds rows
- Throws:
SyntaxNodeException
-
validateTree
protected void validateTree(MatchNode rootNode, List<TableRow> rows, MatchNode[] nodes)
Overrides to do nothing.- Overrides:
validateTreein classMatchAlgorithmCompiler- Parameters:
rootNode- root of treerows- rows to point out errors- See Also:
buildTree(java.util.List<org.openl.rules.cmatch.TableRow>, org.openl.rules.cmatch.MatchNode[])
-
-