blob: cab99a04beb6827410f0c35bf213cc8babb3f874 (
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.grouping.request;
/**
* This is the abstract super class of both {@link GroupingOperation} and {@link GroupingExpression}. All nodes can be
* assigned a {@link String} label which in turn can be used to identify the corresponding result objects.
*
* @author Simon Thoresen Hult
*/
public abstract class GroupingNode {
private final String image;
private String label;
protected GroupingNode(String image, String label) {
this.image = image;
this.label = label;
}
/**
* Returns the label assigned to this grouping expression.
*
* @return The label string.
*/
public String getLabel() {
return label;
}
protected String getImage() { return image; }
/**
* Assigns a label to this grouping expression. The label is applied to the results of this expression so that they
* can be identified by the caller when processing the output.
*
* @param str The label to assign to this.
* @return This, to allow chaining.
*/
public GroupingNode setLabel(String str) {
label = str;
return this;
}
@Override
public String toString() {
return image;
}
}
|