org.modeshape.jcr.query

## Class BufferManager.MakeSortingWithDuplicatesBuffer<K extends Comparable<K>,V>

- java.lang.Object
- - org.modeshape.jcr.query.BufferManager.MakeSortingWithDuplicatesBuffer<K,V>

- All Implemented Interfaces:
    BufferManager.SortingBufferMaker<K,V>
  Enclosing class:
    BufferManager

      protected final class BufferManager.MakeSortingWithDuplicatesBuffer<K extends Comparable<K>,V>
      extends Object
      implements BufferManager.SortingBufferMaker<K,V>

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `BufferManager.MakeSortingWithDuplicatesBuffer(String name, org.mapdb.Serializer<K> keySerializer, Comparator<?> keyComparator, org.mapdb.Serializer<V> valueSerializer)`

  - ### Method Summary

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

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

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

- - ### Constructor Detail

    - #### BufferManager.MakeSortingWithDuplicatesBuffer

          protected BufferManager.MakeSortingWithDuplicatesBuffer(String name,
                                                       org.mapdb.Serializer<K> keySerializer,
                                                       Comparator<?> keyComparator,
                                                       org.mapdb.Serializer<V> valueSerializer)

  - ### Method Detail

    - #### keepSize

          public BufferManager.SortingBufferMaker<K,V> keepSize(boolean keepBufferSize)

      Description copied from interface: `BufferManager.SortingBufferMaker`
      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.
      Specified by:
        `keepSize` in interface `BufferManager.SortingBufferMaker<K extends Comparable<K>,V>`
      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

    - #### useHeap

          public BufferManager.SortingBufferMaker<K,V> useHeap(boolean useHeap)

      Description copied from interface: `BufferManager.SortingBufferMaker`
      Specify whether to store the bufer on the heap.
      Specified by:
        `useHeap` in interface `BufferManager.SortingBufferMaker<K extends Comparable<K>,V>`
      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

    - #### make

          public BufferManager.SortingBuffer<K,V> make()

      Description copied from interface: `BufferManager.SortingBufferMaker`
      Create the `BufferManager.SortingBuffer` instance.
      Specified by:
        `make` in interface `BufferManager.SortingBufferMaker<K extends Comparable<K>,V>`
      Returns:
        the distinct buffer; never null

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