org.modeshape.jcr.query

## Interface BufferManager.SortingBuffer<SortType,RecordType>

- Type Parameters:
    `SortType` - the type of the sorting value
    `RecordType` - the type of record that is to be sorted
  All Superinterfaces:
    AutoCloseable, BufferManager.Buffer
  All Known Implementing Classes:
    BufferManager.CloseableSortingBuffer, BufferManager.CloseableSortingBufferWithDuplicates
  Enclosing class:
    BufferManager

      public static interface BufferManager.SortingBuffer<SortType,RecordType>
      extends BufferManager.Buffer

  A buffer used to sort values into ascending or descending order.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Iterator<RecordType>` | `ascending()` Get an iterator over all of the records in ascending order.
    `Iterator<RecordType>` | `descending()` Get an iterator over all of the records in descending order.
    `Iterator<RecordType>` | `getAll(SortType key)` Get an iterator over all of the records that have the given sortable value.
    `Iterator<RecordType>` | `getAll(SortType lowerKey, boolean includeLowerKey, SortType upperKey, boolean includeUpperKey)` Get an iterator over all of the records that have a sortable value with in the specified range.
    `void` | `put(SortType sortable, RecordType record)` Put the supplied value into the buffer given its sortable value.

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

      `close, isEmpty, size`

- - ### Method Detail

    - #### put

          void put(SortType sortable,
                 RecordType record)

      Put the supplied value into the buffer given its sortable value.
      Parameters:
        `sortable` - the value of the record that is to be used for sorting
        `record` - the record

    - #### ascending

          Iterator<RecordType> ascending()

      Get an iterator over all of the records in ascending order.
      Returns:
        the ascending iterator

    - #### descending

          Iterator<RecordType> descending()

      Get an iterator over all of the records in descending order.
      Returns:
        the ascending iterator

    - #### getAll

          Iterator<RecordType> getAll(SortType key)

      Get an iterator over all of the records that have the given sortable value.
      Parameters:
        `key` - the sortable value
      Returns:
        the iterator; null if there is no entry, or an iterator with one or more values

    - #### getAll

          Iterator<RecordType> getAll(SortType lowerKey,
                                    boolean includeLowerKey,
                                    SortType upperKey,
                                    boolean includeUpperKey)

      Get an iterator over all of the records that have a sortable value with in the specified range.
      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

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