protected override void RetrieveGroupHeadAndAddIfNotExist(int doc) { int key = groupIndex.GetOrd(doc); GroupHead groupHead; if (!ordSet.Exists(key)) { ordSet.Put(key); BytesRef term; if (key == -1) { term = null; } else { term = new BytesRef(); groupIndex.LookupOrd(key, term); } groupHead = new GroupHead(this, doc, term); collectedGroups.Add(groupHead); segmentGroupHeads[key + 1] = groupHead; m_temporalResult.Stop = true; } else { m_temporalResult.Stop = false; groupHead = segmentGroupHeads[key + 1]; } m_temporalResult.GroupHead = groupHead; }
protected override void RetrieveGroupHeadAndAddIfNotExist(int doc) { int ord = groupIndex.GetOrd(doc); BytesRef groupValue; if (ord == -1) { groupValue = null; } else { groupIndex.LookupOrd(ord, scratchBytesRef); groupValue = scratchBytesRef; } if (!groups.TryGetValue(groupValue, out GroupHead groupHead)) { groupHead = new GroupHead(this, groupValue, sortWithinGroup, doc); groups[groupValue == null ? null : BytesRef.DeepCopyOf(groupValue)] = groupHead; m_temporalResult.Stop = true; } else { m_temporalResult.Stop = false; } m_temporalResult.GroupHead = groupHead; }
protected override void RetrieveGroupHeadAndAddIfNotExist(int doc) { filler.FillValue(doc); if (!groups.TryGetValue(mval, out GroupHead groupHead)) { MutableValue groupValue = mval.Duplicate(); groupHead = new GroupHead(this, groupValue, sortWithinGroup, doc); groups[groupValue] = groupHead; m_temporalResult.Stop = true; } else { m_temporalResult.Stop = false; } this.m_temporalResult.GroupHead = groupHead; }
GroupRef(GroupHead head) { this.head = head; }
private Node createGroup(boolean anonymous) { int localIndex = localCount++; int groupIndex = 0; if (!anonymous) groupIndex = capturingGroupCount++; GroupHead head = new GroupHead(localIndex); root = new GroupTail(localIndex, groupIndex); if (!anonymous && groupIndex < 10) groupNodes[groupIndex] = head; return head; }