diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-04-19 17:10:31 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-04-20 10:30:03 +0200 |
commit | 4fa695edbeb3ecc28c16fc7819ac4d92987f9ef4 (patch) | |
tree | dc230735053c7dfb41d3e26e02cbc729a45e7abf /searchlib/src/main | |
parent | 73d8b8f0f3c4b058a8c07a314fafcf4f069169c0 (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.java | 7 |
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. |