public class RealPreconditions extends Object implements PreconditionSet
The preconditions are a set of expressions whose boolean evaluation on a context item
are stored for subsequent retrieval in a lazy fashion
within a Matcher
object.
The method makeRuleSearchState(SimpleMode)
is used to generate a stateful matcher for the preconditions.
The rest of this class should be thread-safe.
Modifier and Type | Field and Description |
---|---|
static long |
diagTime |
Constructor and Description |
---|
RealPreconditions(PatternOptimizationEE patternOptimization) |
Modifier and Type | Method and Description |
---|---|
void |
addAll(Collection<Expression> expressions)
Add a collection of expressions to this set of preconditions, removing duplicates
and counting the number of occurrences
|
static Expression |
applyAxis(byte axis,
Expression e) |
static Set<Expression> |
applyAxis(byte axis,
Set<Expression> exps) |
int |
count(Expression e) |
static Set<Expression> |
difference(Set<Expression> eList1,
Set<Expression> eList2)
Strictly all elements in the union that are not in the intersection
|
static Expression |
evaluatedFunction(Expression e,
Expression isTrue,
PatternOptimizationEE patternOptimization) |
static Set<Expression> |
except(Set<Expression> eList1,
Set<Expression> eList2)
Except between sets - Elist1 less any items that appear in Elist2
|
void |
export(ExpressionPresenter out) |
Map<Expression,Integer> |
getIndexes() |
int |
getRawConditionSize() |
List<Expression> |
getSortedConditions() |
static Set<Expression> |
intersect(Set<Expression> eList1,
Collection<Expression> eList2) |
static boolean |
isContainsLiteral(Expression e)
Ask whether an expression has the form contains(x, L) where L is a string literal
|
static boolean |
isTrue(Expression e)
Ask whether a given expression is the literal boolean value "true()"
|
Matcher |
makeRuleSearchState(SimpleMode mode)
Generate a stateful Matcher for use against this set of preconditions.
|
static Expression |
makeTokenizingComparison(FunctionCall f) |
void |
process()
Carry out 'global' processing on this precondition set.
|
void |
setPatternOptimization(PatternOptimizationEE p) |
static Set<Expression> |
union(Set<Expression> eList1,
Set<Expression> eList2) |
public RealPreconditions(PatternOptimizationEE patternOptimization)
public void setPatternOptimization(PatternOptimizationEE p)
public int getRawConditionSize()
public void addAll(Collection<Expression> expressions)
addAll
in interface PreconditionSet
expressions
- The expressions to be addedpublic Matcher makeRuleSearchState(SimpleMode mode)
makeRuleSearchState
in interface PreconditionSet
mode
- the mode this precondition set is being used inpublic void process()
PreconditionSet
process
in interface PreconditionSet
public int count(Expression e)
public List<Expression> getSortedConditions()
getSortedConditions
in interface PreconditionSet
public Map<Expression,Integer> getIndexes()
getIndexes
in interface PreconditionSet
public void export(ExpressionPresenter out)
export
in interface PreconditionSet
public static Set<Expression> intersect(Set<Expression> eList1, Collection<Expression> eList2)
public static Set<Expression> union(Set<Expression> eList1, Set<Expression> eList2)
public static Set<Expression> except(Set<Expression> eList1, Set<Expression> eList2)
eList1
- eList2
- public static Set<Expression> difference(Set<Expression> eList1, Set<Expression> eList2)
eList1
- eList2
- public static Set<Expression> applyAxis(byte axis, Set<Expression> exps)
public static Expression applyAxis(byte axis, Expression e)
public static boolean isContainsLiteral(Expression e)
e
- the expression to be testedpublic static Expression makeTokenizingComparison(FunctionCall f)
public static Expression evaluatedFunction(Expression e, Expression isTrue, PatternOptimizationEE patternOptimization)
public static boolean isTrue(Expression e)
e
- the expression in questionCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.