aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib/src/main
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-04-19 17:10:31 +0200
committerHenning Baldersheim <balder@yahoo-inc.com>2022-04-20 10:30:03 +0200
commit4fa695edbeb3ecc28c16fc7819ac4d92987f9ef4 (patch)
treedc230735053c7dfb41d3e26e02cbc729a45e7abf /searchlib/src/main
parent73d8b8f0f3c4b058a8c07a314fafcf4f069169c0 (diff)
Cheaper way to get number of children.
Diffstat (limited to 'searchlib/src/main')
-rw-r--r--searchlib/src/main/java/com/yahoo/searchlib/aggregation/Group.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/Group.java b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/Group.java
index 0b4a1eb8bbc..4ff3b342a20 100644
--- a/searchlib/src/main/java/com/yahoo/searchlib/aggregation/Group.java
+++ b/searchlib/src/main/java/com/yahoo/searchlib/aggregation/Group.java
@@ -229,11 +229,16 @@ public class Group extends Identifiable {
return this;
}
- /** Returns the list of child groups to this. */
+ /** Returns immutable list of child groups to this. */
public List<Group> getChildren() {
return List.copyOf(children);
}
+ /** Returns number of children groups */
+ public int getNumChildren() {
+ return children.size();
+ }
+
/**
* Returns the tag of this group. This value is set per-level in the grouping request, and then becomes assigned
* to each group of that level in the grouping result as they are copied from the prototype.