org.modeshape.jcr.query

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

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

- All Implemented Interfaces:
    AutoCloseable, BufferManager.Buffer, BufferManager.SortingBuffer<K,V>
  Enclosing class:
    BufferManager

      protected final class BufferManager.CloseableSortingBufferWithDuplicates<K extends Comparable<K>,V>
      extends BufferManager.CloseableBuffer
      implements BufferManager.SortingBuffer<K,V>

- - ### Field Summary

    - ### Fields inherited from class org.modeshape.jcr.query.BufferManager.CloseableBuffer

      `name, onHeap`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `BufferManager.CloseableSortingBufferWithDuplicates(String name, boolean onHeap, NavigableMap<MapDB.UniqueKey<K>,V> buffer)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Iterator<V>` | `ascending()` Get an iterator over all of the records in ascending order.
    `Iterator<V>` | `descending()` Get an iterator over all of the records in descending order.
    `Iterator<V>` | `getAll(K key)` Get an iterator over all of the records that have the given sortable value.
    `Iterator<V>` | `getAll(K lowerKey, boolean includeLowerKey, K upperKey, boolean includeUpperKey)` Get an iterator over all of the records that have a sortable value with in the specified range.
    `boolean` | `isEmpty()` Determine if this buffer is empty.
    `void` | `put(K sortable, V record)` Put the supplied value into the buffer given its sortable value.
    `long` | `size()` Get the size of the buffer.
    `String` | `toString()`

    - ### Methods inherited from class org.modeshape.jcr.query.BufferManager.CloseableBuffer

      `close`

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

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

    - ### Methods inherited from interface org.modeshape.jcr.query.BufferManager.Buffer

      `close`

- - ### Constructor Detail

    - #### BufferManager.CloseableSortingBufferWithDuplicates

          protected BufferManager.CloseableSortingBufferWithDuplicates(String name,
                                                            boolean onHeap,
                                                            NavigableMap<MapDB.UniqueKey<K>,V> buffer)

  - ### Method Detail

    - #### isEmpty

          public boolean isEmpty()

      Description copied from interface: `BufferManager.Buffer`
      Determine if this buffer is empty. This may be more efficient than `BufferManager.Buffer.size()`.
      Specified by:
        `isEmpty` in interface `BufferManager.Buffer`
      Returns:
        true if the buffer is empty, or false otherwise

    - #### size

          public long size()

      Description copied from interface: `BufferManager.Buffer`
      Get the size of the buffer. This might be more expensive if the buffer is not created with the flag to keep the size.
      Specified by:
        `size` in interface `BufferManager.Buffer`
      Returns:
        the size of the buffer.

    - #### put

          public void put(K sortable,
                 V record)

      Description copied from interface: `BufferManager.SortingBuffer`
      Put the supplied value into the buffer given its sortable value.
      Specified by:
        `put` in interface `BufferManager.SortingBuffer<K extends Comparable<K>,V>`
      Parameters:
        `sortable` - the value of the record that is to be used for sorting
        `record` - the record

    - #### getAll

          public Iterator<V> getAll(K key)

      Description copied from interface: `BufferManager.SortingBuffer`
      Get an iterator over all of the records that have the given sortable value.
      Specified by:
        `getAll` in interface `BufferManager.SortingBuffer<K extends Comparable<K>,V>`
      Parameters:
        `key` - the sortable value
      Returns:
        the iterator; null if there is no entry, or an iterator with one or more values

    - #### getAll

          public Iterator<V> getAll(K lowerKey,
                           boolean includeLowerKey,
                           K upperKey,
                           boolean includeUpperKey)

      Description copied from interface: `BufferManager.SortingBuffer`
      Get an iterator over all of the records that have a sortable value with in the specified range.
      Specified by:
        `getAll` in interface `BufferManager.SortingBuffer<K extends Comparable<K>,V>`
      Parameters:
        `lowerKey` - the minimum sortable value; may be null if there is no minimum
        `includeLowerKey` - true if the values equal to or greater than `lowerKey` value is to be included, or false if only values greater than `lowerKey` should be included
        `upperKey` - the maximum sortable value; may be null if there is no maximum
        `includeUpperKey` - true if the values equal to or less than `upperKey` value are to be included, or false if only values less than `upperKey` should be included
      Returns:
        the iterator; null if there is no entry, or an iterator with one or more values

    - #### ascending

          public Iterator<V> ascending()

      Description copied from interface: `BufferManager.SortingBuffer`
      Get an iterator over all of the records in ascending order.
      Specified by:
        `ascending` in interface `BufferManager.SortingBuffer<K extends Comparable<K>,V>`
      Returns:
        the ascending iterator

    - #### descending

          public Iterator<V> descending()

      Description copied from interface: `BufferManager.SortingBuffer`
      Get an iterator over all of the records in descending order.
      Specified by:
        `descending` in interface `BufferManager.SortingBuffer<K extends Comparable<K>,V>`
      Returns:
        the ascending iterator

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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