org.eclipse.net4j.buffer

## Interface IBufferPool

- All Superinterfaces:
    IBufferProvider
  All Known Subinterfaces:
    IBufferPool.Introspection

      public interface IBufferPool
      extends IBufferProvider

  Provides clients with the ability to obtain and retain pooled `IBuffer`s.
  Author:
    Eike Stepper

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `IBufferPool.Introspection` Offers additional introspection features for `IBufferPool`s.

    - ### Nested classes/interfaces inherited from interface org.eclipse.net4j.buffer.IBufferProvider

      `IBufferProvider.Notification`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `evict(int survivors)` Tries to remove as many buffers from this `BufferPool` and `release` them as are needed to let a given maximum number of buffers survive in the pool.
    `boolean` | `evictOne()` Tries to remove a single buffer from this `BufferPool` and `release` it.

    - ### Methods inherited from interface org.eclipse.net4j.buffer.IBufferProvider

      `getBufferCapacity, provideBuffer, retainBuffer`

- - ### Method Detail

    - #### evictOne

          boolean evictOne()

      Tries to remove a single buffer from this `BufferPool` and `release` it.
      Returns:
        `true` if a buffer could be evicted, `false` otherwise.

    - #### evict

          int evict(int survivors)

      Tries to remove as many buffers from this `BufferPool` and `release` them as are needed to let a given maximum number of buffers survive in the pool.
      Returns:
        The number of buffers that could be evicted.

Copyright (c) 2004-2019 Eike Stepper (Loehne, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html