org.modeshape.jcr.query

## Interface BufferManager.SortingBufferMaker<SortType,RecordType>

- Type Parameters:
    `SortType` - the type of sortable value
    `RecordType` - the type of record to be placed into the buffer
  All Known Implementing Classes:
    BufferManager.MakeSortingBuffer, BufferManager.MakeSortingWithDuplicatesBuffer
  Enclosing class:
    BufferManager

      public static interface BufferManager.SortingBufferMaker<SortType,RecordType>

  An object use to create a new `BufferManager.SortingBuffer`.
  See Also:
    `BufferManager.createSortingBuffer(BTreeKeySerializer, Serializer)`

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `BufferManager.SortingBufferMaker<SortType,RecordType>` | `keepSize(boolean keepBufferSize)` Specify whether to keep track of the buffer size when adding value.
    `BufferManager.SortingBuffer<SortType,RecordType>` | `make()` Create the `BufferManager.SortingBuffer` instance.
    `BufferManager.SortingBufferMaker<SortType,RecordType>` | `useHeap(boolean useHeap)` Specify whether to store the bufer on the heap.

- - ### Method Detail

    - #### useHeap

          BufferManager.SortingBufferMaker<SortType,RecordType> useHeap(boolean useHeap)

      Specify whether to store the bufer on the heap.
      Parameters:
        `useHeap` - true if the buffer's contents are to be stored on the heap, or false if off-heap storage should be used.
      Returns:
        this maker instance; never null

    - #### keepSize

          BufferManager.SortingBufferMaker<SortType,RecordType> keepSize(boolean keepBufferSize)

      Specify whether to keep track of the buffer size when adding value. Doing so may slow adds, but it will make returning the size very quick. Adds may be faster if this is set to false, but asking the buffer for its size requires iterating over the entire buffer and thus may be slower.
      Parameters:
        `keepBufferSize` - true if the buffer is to efficiently track its size, or false if it can skip this and, only if `BufferManager.Buffer.size()` is called, compute the size in a brute force manner.
      Returns:
        this maker instance; never null

    - #### make

          BufferManager.SortingBuffer<SortType,RecordType> make()

      Create the `BufferManager.SortingBuffer` instance.
      Returns:
        the distinct buffer; never null

Copyright © 2008-2014 JBoss, a division of Red Hat. All Rights Reserved.