org.apache.lucene.search.grouping.function

## Class FunctionAllGroupHeadsCollector.GroupHead

- java.lang.Object
- - org.apache.lucene.search.grouping.AbstractAllGroupHeadsCollector.GroupHead<MutableValue>
  - - org.apache.lucene.search.grouping.function.FunctionAllGroupHeadsCollector.GroupHead

Enclosing class:
  FunctionAllGroupHeadsCollector

    public class FunctionAllGroupHeadsCollector.GroupHead
    extends AbstractAllGroupHeadsCollector.GroupHead<MutableValue>

Holds current head document for a single group.

WARNING: This API is experimental and might change in incompatible ways in the next release.

### Field Summary

### Fields inherited from class org.apache.lucene.search.grouping.AbstractAllGroupHeadsCollector.GroupHead

`doc, groupValue`

### Method Summary

Methods
`int` `compare(int compIDX, int doc)` Compares the specified document for a specified comparator against the current most relevant document.
`void` `updateDocHead(int doc)` Updates the current most relevant document with the specified document.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### compare

    public int compare(int compIDX,
              int doc)
                throws IOException

Description copied from class: `AbstractAllGroupHeadsCollector.GroupHead`
Compares the specified document for a specified comparator against the current most relevant document.

Specified by:
  `compare` in class `AbstractAllGroupHeadsCollector.GroupHead<MutableValue>`
Parameters:
  `compIDX` - The comparator index of the specified comparator.
  `doc` - The specified document.
Returns:
  -1 if the specified document wasn't competitive against the current most relevant document, 1 if the specified document was competitive against the current most relevant document. Otherwise 0.
Throws:
  `IOException` - If I/O related errors occur

#### updateDocHead

    public void updateDocHead(int doc)
                       throws IOException

Description copied from class: `AbstractAllGroupHeadsCollector.GroupHead`
Updates the current most relevant document with the specified document.

Specified by:
  `updateDocHead` in class `AbstractAllGroupHeadsCollector.GroupHead<MutableValue>`
Parameters:
  `doc` - The specified document
Throws:
  `IOException` - If I/O related errors occur