Package com.complexible.common.collect

# Class BoundedBuffer<T>

java.lang.Object
com.complexible.common.collect.BoundedBuffer<T>

public class BoundedBuffer<T> extends Object
Adapted from the example in Java Concurrency in Practice to add new methods like pause, resume, size, and uninterruptibles.

Author:
  Brian Goetz and Tim Peierls, Evren Sirin

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `protected final Lock`
  `lock`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BoundedBuffer(int size)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `clear()`
  `void`
  `put(T x)`
  `void`
  `putUninterruptibly(T x)`
  `int`
  `size()`
  `T`
  `take()`
  `T`
  `takeUninterruptibly()`

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

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

- ## Field Details

  - ### lock

    protected final Lock lock

- ## Constructor Details

  - ### BoundedBuffer

    public BoundedBuffer(int size)

- ## Method Details

  - ### put

    public void put(T x) throws InterruptedException
    Throws:
      `InterruptedException`

  - ### take

    public T take() throws InterruptedException
    Throws:
      `InterruptedException`

  - ### putUninterruptibly

    public void putUninterruptibly(T x)

  - ### takeUninterruptibly

    public T takeUninterruptibly()

  - ### clear

    public void clear()

  - ### size

    public int size()