Package com.yahoo.prelude.semantics.rule
Class NotCondition
- java.lang.Object
-
- com.yahoo.prelude.semantics.rule.Condition
-
- com.yahoo.prelude.semantics.rule.NotCondition
-
public class NotCondition extends Condition
A condition which matches if its contained condition doesn't. NotCondition inverts the term checking but not the label checking. That is, it means "label:!term", it does not mean "!label:term".- Author:
- bratseth
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.yahoo.prelude.semantics.rule.Condition
Condition.Anchor
-
-
Constructor Summary
Constructors Constructor Description NotCondition(Condition condition)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
doesMatch(RuleEvaluation e)
Returns whether this condition matches the given evaluation at the current location of the evaluation.Condition
getCondtiion()
protected boolean
hasOpenChoicepoint(RuleEvaluation evaluation)
Returns whether there is an open choice in this or any of its subconditions.void
makeReferences(RuleBase ruleBase)
Override if references needs to be set in this condition of its childrenvoid
setCondition(Condition condition)
String
toInnerString()
All instances of this produces a parseable string output-
Methods inherited from class com.yahoo.prelude.semantics.rule.Condition
getAnchor, getContextName, getLabel, getLabelString, getMatchInfo, getMatchInfoString, getNameSpace, getParent, isDefaultContextName, isReferable, labelMatches, labelMatches, matches, matchesEndAnchor, matchesStartAnchor, postMatchHook, preMatchHook, setAnchor, setContextName, setLabel, setNameSpace, toString, traceResult
-
-
-
-
Constructor Detail
-
NotCondition
public NotCondition(Condition condition)
-
-
Method Detail
-
getCondtiion
public Condition getCondtiion()
-
setCondition
public void setCondition(Condition condition)
-
doesMatch
protected boolean doesMatch(RuleEvaluation e)
Description copied from class:Condition
Returns whether this condition matches the given evaluation at the current location of the evaluation. If there is a match, the evaluation must be advanced to the location beyond the matching item(s) before this method returns.
-
toInnerString
public String toInnerString()
Description copied from class:Condition
All instances of this produces a parseable string output- Specified by:
toInnerString
in classCondition
-
makeReferences
public void makeReferences(RuleBase ruleBase)
Description copied from class:Condition
Override if references needs to be set in this condition of its children- Overrides:
makeReferences
in classCondition
-
hasOpenChoicepoint
protected boolean hasOpenChoicepoint(RuleEvaluation evaluation)
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
-
-