blob: d6de81e78cc4b0acf1d6bac8bdabfacaad59f46c (
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
|
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.searchlib.expression;
/**
* This function is an instruction to concatenate the bits of all arguments in order.
*
* @author baldersheim
* @author Simon Thoresen Hult
*/
public class StrCatFunctionNode extends MultiArgFunctionNode {
public static final int classId = registerClass(0x4000 + 133, StrCatFunctionNode.class);
@Override
protected int onGetClassId() {
return classId;
}
@Override
protected boolean equalsMultiArgFunction(MultiArgFunctionNode obj) {
return true;
}
@Override
protected void onPrepareResult() {
setResult(new StringResultNode());
}
@Override
protected void onPrepare() {
super.onPrepare();
}
@Override
protected boolean onExecute() {
for (int i = 0; i < getNumArgs(); i++) {
getArg(i).execute();
((StringResultNode)getResult()).append(getArg(i).getResult());
}
return true;
}
}
|