blob: db501f2325a2416bdd2b731a06655440943dab1c (
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 2017 Yahoo Holdings. 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);
}
}
|