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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCondition(Condition condition) protected final booleanReturns whether all the conditions of this matches the current evaluation stateReturns an iterator of the immediate children of this conditionintReturns the number of subconditionsprotected final StringconditionsToString(String conditionSeparator) getCondition(int i) Returns the condition at the given indexprotected booleanhasOpenChoicepoint(RuleEvaluation evaluation) Returns whether there is an open choice in this or any of its subconditions.voidmakeReferences(RuleBase rules) Override if references needs to be set in this condition of its childrenvoidCalled just before match returns, on any return condition including exceptions.voidCalled when match is called, before anything else.removeCondition(int i) Returns the condition at the given indexvoidsetCondition(int index, Condition condition) Sets the condition at the given indexprotected StringtoInnerString(String conditionSeparator) protected booleanWhether this should be output with parentheses, default is parent!Methods 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:ConditionCalled when match is called, before anything else. Always call super.preMatchHook when overriding.- Overrides:
preMatchHookin classCondition
-
postMatchHook
Description copied from class:ConditionCalled just before match returns, on any return condition including exceptions. Always call super.postMatchHook when overriding- Overrides:
postMatchHookin classCondition
-
hasOpenChoicepoint
Description copied from class:ConditionReturns 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:
hasOpenChoicepointin 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:ConditionOverride if references needs to be set in this condition of its children- Overrides:
makeReferencesin 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
-