Example usage for org.apache.commons.collections4.queue CircularFifoQueue addAll

List of usage examples for org.apache.commons.collections4.queue CircularFifoQueue addAll

Introduction

In this page you can find the example usage for org.apache.commons.collections4.queue CircularFifoQueue addAll.

Prototype

boolean addAll(Collection<? extends E> c);

Source Link

Document

Adds all of the elements in the specified collection to this collection (optional operation).

Usage

From source file:org.socraticgrid.hl7.services.orders.functional.EventLogger.java

/**
 * @param eventBufferSize/*from   ww  w.  j a  v  a2 s  .c  o m*/
 *            the eventBufferSize to set
 */
public void setEventBufferSize(int eventBufferSize) {

    if (this.eventQueue != null && (this.eventBufferSize != eventBufferSize)) {
        // Resize the buffer as required
        CircularFifoQueue<LogEntry> newQueue = new CircularFifoQueue<LogEntry>(eventBufferSize);
        // Move old entries to the new Buffer
        newQueue.addAll(eventQueue);
        eventQueue.clear();
        eventQueue = newQueue;
    }
    this.eventBufferSize = eventBufferSize;
}