Package com.yahoo.prelude.semantics.rule
Class CompositeCondition
java.lang.Object
com.yahoo.prelude.semantics.rule.Condition
com.yahoo.prelude.semantics.rule.CompositeCondition
- Direct Known Subclasses:
AndCondition
,ChoiceCondition
,ComparisonCondition
,CompositeItemCondition
,SequenceCondition
A condition which contains a list of conditions
- Author:
- bratseth
-
Nested Class Summary
Nested classes/interfaces inherited from class com.yahoo.prelude.semantics.rule.Condition
Condition.Anchor
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCondition
(Condition condition) protected final boolean
Returns whether all the conditions of this matches the current evaluation stateReturns an iterator of the immediate children of this conditionint
Returns the number of subconditionsprotected final String
conditionsToString
(String conditionSeparator) getCondition
(int i) Returns the condition at the given indexprotected boolean
hasOpenChoicepoint
(RuleEvaluation evaluation) Returns whether there is an open choice in this or any of its subconditions.void
makeReferences
(RuleBase rules) Override if references needs to be set in this condition of its childrenvoid
Called just before match returns, on any return condition including exceptions.void
Called when match is called, before anything else.removeCondition
(int i) Returns the condition at the given indexvoid
setCondition
(int index, Condition condition) Sets the condition at the given indexprotected String
toInnerString
(String conditionSeparator) protected boolean
Whether this should be output with parentheses, default is parent!=nullMethods inherited from class com.yahoo.prelude.semantics.rule.Condition
doesMatch, getAnchor, getContextName, getLabel, getLabelString, getMatchInfo, getMatchInfoString, getNameSpace, getParent, isDefaultContextName, isReferable, labelMatches, labelMatches, matches, matchesEndAnchor, matchesStartAnchor, setAnchor, setContextName, setLabel, setNameSpace, toInnerString, toString, traceResult
-
Constructor Details
-
CompositeCondition
public CompositeCondition()
-
-
Method Details
-
preMatchHook
Description copied from class:Condition
Called when match is called, before anything else. Always call super.preMatchHook when overriding.- Overrides:
preMatchHook
in classCondition
-
postMatchHook
Description copied from class:Condition
Called just before match returns, on any return condition including exceptions. Always call super.postMatchHook when overriding- Overrides:
postMatchHook
in classCondition
-
hasOpenChoicepoint
Description copied from class:Condition
Returns whether there is an open choice in this or any of its subconditions. Returns false by default, must be overriden by conditions which may generate choices open accross multiple calls to matches, or contain such conditions.- Overrides:
hasOpenChoicepoint
in classCondition
-
addCondition
-
setCondition
Sets the condition at the given index -
conditionSize
public int conditionSize()Returns the number of subconditions -
getCondition
Returns the condition at the given index- Parameters:
i
- the 0-base index- Returns:
- the condition at this index
- Throws:
IndexOutOfBoundsException
- if there is no condition at this index
-
removeCondition
Returns the condition at the given index- Parameters:
i
- the 0-base index- Returns:
- the removed condition
- Throws:
IndexOutOfBoundsException
- if there is no condition at this index
-
conditionIterator
Returns an iterator of the immediate children of this condition -
conditions
-
makeReferences
Description copied from class:Condition
Override if references needs to be set in this condition of its children- Overrides:
makeReferences
in classCondition
-
useParentheses
protected boolean useParentheses()Whether this should be output with parentheses, default is parent!=null -
toInnerString
-
conditionsToString
-
allSubConditionsMatches
Returns whether all the conditions of this matches the current evaluation state
-