## org.apache.lucene.search.suggest
Class SortedTermFreqIteratorWrapper

    java.lang.Object
      org.apache.lucene.search.suggest.SortedTermFreqIteratorWrapper

All Implemented Interfaces:
  TermFreqIterator, org.apache.lucene.util.BytesRefIterator

    public class SortedTermFreqIteratorWrapper

extends Object
implements TermFreqIterator

This wrapper buffers incoming elements and makes sure they are sorted based on given comparator.

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

Nested Class Summary

Nested classes/interfaces inherited from interface org.apache.lucene.search.spell.TermFreqIterator
`TermFreqIterator.TermFreqIteratorWrapper`

Field Summary

Fields inherited from interface org.apache.lucene.util.BytesRefIterator
`EMPTY`

Constructor Summary
`SortedTermFreqIteratorWrapper(TermFreqIterator source, Comparator<org.apache.lucene.util.BytesRef> comparator)`
`SortedTermFreqIteratorWrapper(TermFreqIterator source, Comparator<org.apache.lucene.util.BytesRef> comparator, boolean compareRawBytes)`

Method Summary
`protected long` `decode(org.apache.lucene.util.BytesRef scratch, org.apache.lucene.store.ByteArrayDataInput tmpInput)`
`protected void` `encode(Sort.ByteSequencesWriter writer, org.apache.lucene.store.ByteArrayDataOutput output, byte[] buffer, org.apache.lucene.util.BytesRef spare, long weight)`
`Comparator<org.apache.lucene.util.BytesRef>` `getComparator()`
`org.apache.lucene.util.BytesRef` `next()`
`long` `weight()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### SortedTermFreqIteratorWrapper

    public SortedTermFreqIteratorWrapper(TermFreqIterator source,
                                         Comparator<org.apache.lucene.util.BytesRef> comparator)
                                  throws IOException

Throws:
  `IOException`

### SortedTermFreqIteratorWrapper

    public SortedTermFreqIteratorWrapper(TermFreqIterator source,
                                         Comparator<org.apache.lucene.util.BytesRef> comparator,
                                         boolean compareRawBytes)
                                  throws IOException

Throws:
  `IOException`

Method Detail

### next

    public org.apache.lucene.util.BytesRef next()
                                         throws IOException

  Specified by:
    `next` in interface `org.apache.lucene.util.BytesRefIterator`
  Throws:
    `IOException`

### getComparator

    public Comparator<org.apache.lucene.util.BytesRef> getComparator()

  Specified by:
    `getComparator` in interface `org.apache.lucene.util.BytesRefIterator`

### weight

    public long weight()

  Specified by:
    `weight` in interface `TermFreqIterator`

### encode

    protected void encode(Sort.ByteSequencesWriter writer,
                          org.apache.lucene.store.ByteArrayDataOutput output,
                          byte[] buffer,
                          org.apache.lucene.util.BytesRef spare,
                          long weight)
                   throws IOException

  Throws:
    `IOException`

### decode

    protected long decode(org.apache.lucene.util.BytesRef scratch,
                          org.apache.lucene.store.ByteArrayDataInput tmpInput)