Class ChoiceExpression
java.lang.Object
com.yahoo.vespa.objects.Selectable
com.yahoo.vespa.indexinglanguage.expressions.Expression
com.yahoo.vespa.indexinglanguage.expressions.CompositeExpression
com.yahoo.vespa.indexinglanguage.expressions.ExpressionList<Expression>
com.yahoo.vespa.indexinglanguage.expressions.ChoiceExpression
- All Implemented Interfaces:
Iterable<Expression>
An expression which returns the value of the first of a list of subexpressions which
returns a non-null value.
Syntax: sub-expression1 || sub-expression2 || ...
- Author:
- bratseth
-
Constructor Summary
ConstructorsConstructorDescriptionChoiceExpression(Expression... choices) ChoiceExpression(Collection<? extends Expression> choices) -
Method Summary
Modifier and TypeMethodDescriptionconvertChildren(ExpressionConverter converter) Returns an expression where the children of this has been converted using the given converter.protected voiddoExecute(ExecutionContext context) booleancom.yahoo.document.DataTypesetInputType(com.yahoo.document.DataType inputType, TypeContext context) Sets the input type of this and returns the resulting output type, or null if it cannot be uniquely determined.com.yahoo.document.DataTypesetOutputType(com.yahoo.document.DataType outputType, TypeContext context) Sets the output type of this and returns the resulting input type, or null if it cannot be uniquely determined.toString()Methods inherited from class com.yahoo.vespa.indexinglanguage.expressions.ExpressionList
asList, convertChildList, expressions, get, hashCode, isEmpty, iterator, requiresInput, selectMembers, setStatementOutput, sizeMethods inherited from class com.yahoo.vespa.indexinglanguage.expressions.CompositeExpression
toScriptBlockMethods inherited from class com.yahoo.vespa.indexinglanguage.expressions.Expression
doResolve, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, fromString, fromString, getInputType, getOutputType, getOutputType, isMutating, leastGeneralNonNullOf, leastGeneralOf, mostGeneralOf, newInstance, requireOutputType, resolve, resolve, resolve, resolve, resolve, resolve, resolve, resolve, resolve, setInputType, setOutputTypeMethods inherited from class com.yahoo.vespa.objects.Selectable
select, selectMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
ChoiceExpression
public ChoiceExpression() -
ChoiceExpression
-
ChoiceExpression
-
-
Method Details
-
convertChildren
Description copied from class:ExpressionReturns an expression where the children of this has been converted using the given converter. This default implementation returns this as it has no children.- Specified by:
convertChildrenin classCompositeExpression
-
setInputType
public com.yahoo.document.DataType setInputType(com.yahoo.document.DataType inputType, TypeContext context) Description copied from class:ExpressionSets the input type of this and returns the resulting output type, or null if it cannot be uniquely determined. Subtypes may implement this by calling setInputType(inputType, requiredType, VerificationContext context).- Overrides:
setInputTypein classExpression
-
setOutputType
public com.yahoo.document.DataType setOutputType(com.yahoo.document.DataType outputType, TypeContext context) Description copied from class:ExpressionSets the output type of this and returns the resulting input type, or null if it cannot be uniquely determined. Subtypes implement this by calling setOutputType(outputType, requiredType, VerificationContext context).- Overrides:
setOutputTypein classExpression
-
doExecute
- Specified by:
doExecutein classExpression
-
toString
-
equals
- Overrides:
equalsin classExpressionList<Expression>
-