@@ -17,7 +17,7 @@ public abstract class AbstractGroupNode<InTuple_ extends Tuple, OutTuple_ extend
1717
1818 private final int groupStoreIndex ;
1919 /**
20- * Unused when {@link #hasMultipleGroups } is false.
20+ * Unused when {@link #hasGroupKeyFunction } is false.
2121 */
2222 private final Function <InTuple_ , GroupKey_ > groupKeyFunction ;
2323 /**
@@ -32,18 +32,18 @@ public abstract class AbstractGroupNode<InTuple_ extends Tuple, OutTuple_ extend
3232 * Some code paths may decide to not supply a grouping function.
3333 * In that case, every tuple accumulates into {@link #singletonGroup} and not to {@link #groupMap}.
3434 */
35- private final boolean hasMultipleGroups ;
35+ private final boolean hasGroupKeyFunction ;
3636 /**
3737 * Some code paths may decide to not supply a collector.
3838 * In that case, we skip the code path that would attempt to use it.
3939 */
4040 private final boolean hasCollector ;
4141 /**
42- * Used when {@link #hasMultipleGroups } is true, otherwise {@link #singletonGroup} is used.
42+ * Used when {@link #hasGroupKeyFunction } is true, otherwise {@link #singletonGroup} is used.
4343 */
4444 private final Map <Object , Group <OutTuple_ , ResultContainer_ >> groupMap ;
4545 /**
46- * Used when {@link #hasMultipleGroups } is false, otherwise {@link #groupMap} is used.
46+ * Used when {@link #hasGroupKeyFunction } is false, otherwise {@link #groupMap} is used.
4747 *
4848 * @implNote The field is lazy initialized in order to maintain the same semantics as with the groupMap above.
4949 * When all tuples are removed, the field will be set to null, as if the group never existed.
@@ -60,14 +60,14 @@ protected AbstractGroupNode(int groupStoreIndex, Function<InTuple_, GroupKey_> g
6060 this .groupKeyFunction = groupKeyFunction ;
6161 this .supplier = supplier ;
6262 this .finisher = finisher ;
63- this .hasMultipleGroups = groupKeyFunction != null ;
63+ this .hasGroupKeyFunction = groupKeyFunction != null ;
6464 this .hasCollector = supplier != null ;
6565 /*
6666 * Not using the default sizing to 1000.
6767 * The number of groups can be very small, and that situation is not unlikely.
6868 * Therefore, the size of these collections is kept default.
6969 */
70- this .groupMap = hasMultipleGroups ? new HashMap <>() : null ;
70+ this .groupMap = hasGroupKeyFunction ? new HashMap <>() : null ;
7171 this .propagationQueue = hasCollector ? new DynamicPropagationQueue <>(nextNodesTupleLifecycle ,
7272 group -> {
7373 var outTuple = group .getTuple ();
@@ -99,7 +99,7 @@ public final void insert(InTuple_ tuple) {
9999 "Impossible state: the input for the tuple (%s) was already added in the tupleStore."
100100 .formatted (tuple ));
101101 }
102- var userSuppliedKey = hasMultipleGroups ? groupKeyFunction .apply (tuple ) : null ;
102+ var userSuppliedKey = hasGroupKeyFunction ? groupKeyFunction .apply (tuple ) : null ;
103103 createTuple (tuple , userSuppliedKey );
104104 }
105105
@@ -124,7 +124,7 @@ private void createTuple(InTuple_ tuple, GroupKey_ userSuppliedKey) {
124124
125125 private Group <OutTuple_ , ResultContainer_ > getOrCreateGroup (GroupKey_ userSuppliedKey ) {
126126 var groupMapKey = useAssertingGroupKey ? new AssertingGroupKey <>(userSuppliedKey ) : userSuppliedKey ;
127- if (hasMultipleGroups ) {
127+ if (hasGroupKeyFunction ) {
128128 // Avoids computeIfAbsent in order to not create lambdas on the hot path.
129129 var group = groupMap .get (groupMapKey );
130130 if (group == null ) {
@@ -178,7 +178,7 @@ public final void update(InTuple_ tuple) {
178178 insert (tuple );
179179 return ;
180180 }
181- if (!hasMultipleGroups ) {
181+ if (!hasGroupKeyFunction ) {
182182 updateGroup (tuple , oldGroup );
183183 return ;
184184 }
@@ -220,7 +220,7 @@ private void updateGroup(InTuple_ tuple, Group<OutTuple_, ResultContainer_> oldG
220220 */
221221 private void killOutTuple (Group <OutTuple_ , ResultContainer_ > group , boolean killGroup ) {
222222 if (killGroup ) {
223- var groupKey = hasMultipleGroups ? group .getGroupKey () : null ;
223+ var groupKey = hasGroupKeyFunction ? group .getGroupKey () : null ;
224224 var oldGroup = removeGroup (groupKey );
225225 if (oldGroup == null ) {
226226 throw new IllegalStateException ("""
@@ -255,7 +255,7 @@ private void killOutTuple(Group<OutTuple_, ResultContainer_> group, boolean kill
255255 }
256256
257257 private Group <OutTuple_ , ResultContainer_ > removeGroup (Object groupKey ) {
258- if (hasMultipleGroups ) {
258+ if (hasGroupKeyFunction ) {
259259 return groupMap .remove (groupKey );
260260 } else {
261261 var oldGroup = singletonGroup ;
0 commit comments