org.modeshape.jcr.query

## Class BufferManager.CloseableQueueBuffer<T>

- java.lang.Object
- - org.modeshape.jcr.query.BufferManager.CloseableBuffer
  - - org.modeshape.jcr.query.BufferManager.CloseableQueueBuffer<T>

- All Implemented Interfaces:
    AutoCloseable, Iterable<T>, BufferManager.Buffer, BufferManager.QueueBuffer<T>
  Enclosing class:
    BufferManager

      protected final class BufferManager.CloseableQueueBuffer<T>
      extends BufferManager.CloseableBuffer
      implements BufferManager.QueueBuffer<T>

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Map<Long,T>` | `buffer`

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

      `name, onHeap`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `BufferManager.CloseableQueueBuffer(String name, boolean onHeap, Map<Long,T> buffer)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `append(T value)` Add a value to the end of this buffer.
    `boolean` | `isEmpty()` Determine if this buffer is empty.
    `Iterator<T>` | `iterator()` Get an iterator over all of the values.
    `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`

- - ### Field Detail

    - #### buffer

          protected final Map<Long,T> buffer

  - ### Constructor Detail

    - #### BufferManager.CloseableQueueBuffer

          protected BufferManager.CloseableQueueBuffer(String name,
                                            boolean onHeap,
                                            Map<Long,T> 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.

    - #### append

          public void append(T value)

      Description copied from interface: `BufferManager.QueueBuffer`
      Add a value to the end of this buffer.
      Specified by:
        `append` in interface `BufferManager.QueueBuffer<T>`
      Parameters:
        `value` - the value to be added; may be null

    - #### iterator

          public Iterator<T> iterator()

      Description copied from interface: `BufferManager.QueueBuffer`
      Get an iterator over all of the values.
      Specified by:
        `iterator` in interface `Iterable<T>`
      Specified by:
        `iterator` in interface `BufferManager.QueueBuffer<T>`
      Returns:
        the iterator; never null

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

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