Class ChoiceExpression

All Implemented Interfaces:
Iterable<Expression>

public class ChoiceExpression extends ExpressionList<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 Details

    • ChoiceExpression

      public ChoiceExpression()
    • ChoiceExpression

      public ChoiceExpression(Expression... choices)
    • ChoiceExpression

      public ChoiceExpression(Collection<? extends Expression> choices)
  • Method Details

    • convertChildren

      public ChoiceExpression convertChildren(ExpressionConverter converter)
      Description copied from class: Expression
      Returns 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:
      convertChildren in class CompositeExpression
    • setInputType

      public com.yahoo.document.DataType setInputType(com.yahoo.document.DataType inputType, TypeContext context)
      Description copied from class: Expression
      Sets 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:
      setInputType in class Expression
    • setOutputType

      public com.yahoo.document.DataType setOutputType(com.yahoo.document.DataType outputType, TypeContext context)
      Description copied from class: Expression
      Sets 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:
      setOutputType in class Expression
    • doExecute

      protected void doExecute(ExecutionContext context)
      Specified by:
      doExecute in class Expression
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class ExpressionList<Expression>