public class ComparisonPredicateIndex extends Object
IndexMatcher
class can be used, behaving as a sequence iterator
to yield successive candidate matching Rules (wrapped in ObjectValue).
This stateful iterator can be created via makeRuleSearchState(SimpleMode)
and then initialised for processing a specific context item via the
IndexMatcher.prepareEval(Item, XPathContext)
method.Modifier and Type | Class and Description |
---|---|
class |
ComparisonPredicateIndex.AncestorQualifiedRuleCase
A rule case which has ancestral qualification.
|
class |
ComparisonPredicateIndex.IndexBase
A class that is used to index sets of rules with common forms,
such as patt[expr = value] where
patt - the base pattern and
expr - the LHS of a comparison
are common
By matching instances of this class we can group rules that have similar
'left hand sides' for indexation
|
class |
ComparisonPredicateIndex.RuleCase
A class to contain a rule (held as an ObjectValue, which is an Item)
and a possible matching condition
|
class |
ComparisonPredicateIndex.RuleIndex
A class to contain a list of rules
indexed against a set of atomic value match keys.
|
class |
ComparisonPredicateIndex.ValueObject<R>
A class to encapsulate an atomic value and associated Object (usually a Rule)
|
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_MIN_RULES |
Map<ComparisonPredicateIndex.IndexBase,ComparisonPredicateIndex.RuleIndex> |
indicies |
Constructor and Description |
---|
ComparisonPredicateIndex() |
Modifier and Type | Method and Description |
---|---|
void |
add(Rule r)
Add a rule to a simple index if possible
|
void |
explain(ExpressionPresenter out) |
IndexMatcher |
makeRuleSearchState(SimpleMode mode) |
com.saxonica.ee.pattern.preconditions.ComparisonPredicateIndex.IndexAndRHS |
maybeDITAIndexable(AncestorQualifiedPattern p)
Determine whether this AncestorQualifiedPattern can be indexed
against the semantics of DITA-OT stylesheets
and if so return a suitable index/value pair
|
com.saxonica.ee.pattern.preconditions.ComparisonPredicateIndex.IndexAndRHS |
maybeDITAIndexable(PatternWithPredicate p)
Determine whether this pattern can be indexed against the semantics of DITA-OT stylesheets
and if so return a suitable indexation index/value pair.
|
com.saxonica.ee.pattern.preconditions.ComparisonPredicateIndex.IndexAndRHS |
maybeIndexable(AncestorQualifiedPattern p)
Determine whether this AncestorQualifiedPattern can be indexed
and if so return a suitable index/value pair
Note that only the base pattern is used in the index;
the upper pattern is associated with the rule and is attached to the
rule list members - in this way flat and ancestor-qualified patterns
that share the same base (e.g.
|
void |
optimize()
Optimize the indicies - in fact it is essential
this is executed, to form up the internal indexes.
|
void |
setDita(boolean dita)
Enable DITA-OT optimization
|
void |
setMinRules(int minRules) |
int |
size() |
public static int DEFAULT_MIN_RULES
public Map<ComparisonPredicateIndex.IndexBase,ComparisonPredicateIndex.RuleIndex> indicies
public IndexMatcher makeRuleSearchState(SimpleMode mode)
public void setDita(boolean dita)
dita
- public void setMinRules(int minRules)
public void explain(ExpressionPresenter out)
public int size()
public void optimize()
public com.saxonica.ee.pattern.preconditions.ComparisonPredicateIndex.IndexAndRHS maybeIndexable(AncestorQualifiedPattern p)
p
- the pattern to testpublic com.saxonica.ee.pattern.preconditions.ComparisonPredicateIndex.IndexAndRHS maybeDITAIndexable(PatternWithPredicate p)
p
- the pattern to testpublic com.saxonica.ee.pattern.preconditions.ComparisonPredicateIndex.IndexAndRHS maybeDITAIndexable(AncestorQualifiedPattern p)
p
- the pattern to testpublic void add(Rule r)
r
- the template rule to be checked and indexed if possibleCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.