public class RuleOptimized extends Rule
Modifier and Type | Field and Description |
---|---|
protected int[] |
preconditionIndexes |
protected Set<Expression> |
preconditions |
action, minImportPrecedence, next, pattern, precedence, priority, sequence
Constructor and Description |
---|
RuleOptimized(Pattern p,
RuleTarget o,
int prec,
int min,
double prio,
int seq) |
RuleOptimized(RuleOptimized r) |
Modifier and Type | Method and Description |
---|---|
void |
evalPreconditions(PatternOptimizationEE patternOptimization)
Evaluate the effect of the preconditions on the rule pattern, i.e.
|
void |
exportOtherProperties(ExpressionPresenter out)
Add other exported properties as required
|
void |
findPreconditions(PatternOptimizationEE patternOptimization,
ItemType type) |
int[] |
getPreconditionIndexes() |
Set<Expression> |
getPreconditions() |
void |
optimizeForName(int fingerprint)
Optimize the pattern for a rule with respect to a named node (element or attribute).
|
void |
optimizeForType(int type)
Optimize the pattern of a rule with respect to a typed node.
|
void |
optimizePattern()
Generic optimization of the pattern of a rule
|
void |
reduceAndIndexPreconditions(Map<Expression,Integer> index)
Retain only preconditions that are retained globally and set the index
Set the indexes of the preconditions, so that simple access into the matcher state can be used
|
compareComputedRank, compareRank, export, getAction, getMinImportPrecedence, getNext, getPattern, getPrecedence, getPriority, getRank, getSequence, isAlwaysMatches, matches, setAction, setAlwaysMatches, setNext, setPattern, setRank
protected Set<Expression> preconditions
protected int[] preconditionIndexes
public RuleOptimized(Pattern p, RuleTarget o, int prec, int min, double prio, int seq)
public RuleOptimized(RuleOptimized r)
public Set<Expression> getPreconditions()
public int[] getPreconditionIndexes()
public void findPreconditions(PatternOptimizationEE patternOptimization, ItemType type)
public void exportOtherProperties(ExpressionPresenter out)
Rule
exportOtherProperties
in class Rule
out
- the export destinationpublic void reduceAndIndexPreconditions(Map<Expression,Integer> index)
index
- map of the indexes for each preconditionpublic void evalPreconditions(PatternOptimizationEE patternOptimization)
public void optimizeForName(int fingerprint)
fingerprint
- the fingerprint of the name of the node to be matched.public void optimizeForType(int type)
type
- the type of the node to be matched.public void optimizePattern()
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.