aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/rule/CompositeNode.java
blob: d8199669b05c8e3c89133c9621cb9458acb9c492 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.searchlib.rankingexpression.rule;

import java.util.List;

/**
 * The parent of all node types which contains child nodes.
 *
 * @author bratseth
 */
public abstract class CompositeNode extends ExpressionNode {

    /**
     * Returns a read-only list containing the immediate children of this composite.
     *
     * @return The children of this.
     */
    public abstract List<ExpressionNode> children();

    /**
     * Returns a copy of this where the children is replaced by the given children.
     *
     * @throws IllegalArgumentException if the given list of children has different size than children()
     */
    public abstract CompositeNode setChildren(List<ExpressionNode> children);

}