Code example for ArrayDeque

Methods: clear

0
     * Get the events currently buffered. Returns null if the buffer is empty. Flushes the buffer. 
     * @return array of events in buffer or null if empty 
     */ 
    public EventBean[] getAndFlush() 
    { 
        EventBean[] flattened = EventBeanUtility.flatten(remainEvents); 
        remainEvents.clear(); 
        return flattened; 
    } 
 
    /** 
     * Empty buffer. 
     */ 
    public void flush() 
    { 
        remainEvents.clear(); 
    } 
}