org.apache.lucene.search.grouping

## Class AbstractAllGroupHeadsCollector.GroupHead<GROUP_VALUE_TYPE>

- java.lang.Object
- - org.apache.lucene.search.grouping.AbstractAllGroupHeadsCollector.GroupHead<GROUP_VALUE_TYPE>

Direct Known Subclasses:
  FunctionAllGroupHeadsCollector.GroupHead

Enclosing class:
  AbstractAllGroupHeadsCollector<GH extends AbstractAllGroupHeadsCollector.GroupHead>

    public abstract static class AbstractAllGroupHeadsCollector.GroupHead<GROUP_VALUE_TYPE>
    extends Object

Represents a group head. A group head is the most relevant document for a particular group. The relevancy is based is usually based on the sort. The group head contains a group value with its associated most relevant document id.

### Field Summary

Fields
`int` `doc`
`GROUP_VALUE_TYPE` `groupValue`

### Constructor Summary

Constructors
`protected` `AbstractAllGroupHeadsCollector.GroupHead(GROUP_VALUE_TYPE groupValue, int doc)`

### Method Summary

Methods
`protected abstract int` `compare(int compIDX, int doc)` Compares the specified document for a specified comparator against the current most relevant document.
`protected abstract 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`

### Field Detail

#### groupValue

    public final GROUP_VALUE_TYPE groupValue

#### doc

    public int doc

### Constructor Detail

#### AbstractAllGroupHeadsCollector.GroupHead

    protected AbstractAllGroupHeadsCollector.GroupHead(GROUP_VALUE_TYPE groupValue,
                                            int doc)

### Method Detail

#### compare

    protected abstract int compare(int compIDX,
              int doc)
                            throws IOException

Compares the specified document for a specified comparator against the current most relevant document.

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

    protected abstract void updateDocHead(int doc)
                                   throws IOException

Updates the current most relevant document with the specified document.

Parameters:
  `doc` - The specified document
Throws:
  `IOException` - If I/O related errors occur