blob: 12f6df1f4971156f6ca23a47bd7181d4d7ece8a6 (
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
|
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.search.grouping.request;
/**
* This is a grouping operation that processes each element of the input list separately, as opposed to {@link
* AllOperation} which processes that list as a whole.
*
* @author <a href="mailto:simon@yahoo-inc.com">Simon Thoresen</a>
*/
public class EachOperation extends GroupingOperation {
/**
* Constructs a new instance of this class.
*/
public EachOperation() {
super("each");
}
@Override
public void resolveLevel(int level) {
if (level == 0) {
throw new IllegalArgumentException("Operation '" + this + "' can not operate on " + getLevelDesc(level) + ".");
}
super.resolveLevel(level - 1);
}
}
|