public class GeneralPatternOptimizer extends PatternOptimizer
Constructor and Description |
---|
GeneralPatternOptimizer() |
Modifier and Type | Method and Description |
---|---|
boolean |
appliesTo(Pattern pattern)
Ask whether this pattern optimizer is applicable to a particular pattern
|
static GeneralPatternOptimizer |
getInstance() |
void |
process(RuleEE rule,
Pattern pattern,
java.util.Map<Precondition,java.util.List<RuleEE>> preconditions,
java.util.Map<Characteristic,Characteristic> characteristics)
Process a particular pattern, potentially adding to the list of preconditions and characteristics
maintained when processing a set of rules
|
addPrecondition, allocateCharacteristic
public static GeneralPatternOptimizer getInstance()
public boolean appliesTo(Pattern pattern)
PatternOptimizer
appliesTo
in class PatternOptimizer
pattern
- the pattern in questionpublic void process(RuleEE rule, Pattern pattern, java.util.Map<Precondition,java.util.List<RuleEE>> preconditions, java.util.Map<Characteristic,Characteristic> characteristics)
PatternOptimizer
process
in class PatternOptimizer
rule
- the rule to be processedpattern
- the pattern used by this rulepreconditions
- a collection of preconditions maintained for a set of rulescharacteristics
- a collection of characteristics maintained for a set of rules.
This is maintained as a map from characteristics
to characteristics in which the key and the value are always the same; the reason for this
curious structure is that when an equivalent characteristic is already present in the map,
we want to return the existing characteristic to replace the new one; a Java Set
does not have any (efficient) operation to "find the existing value in the set that is equal
to X".Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.