Code example for ArrayBlockingQueue

Methods: adddrainTosize

			// Add m to the mAccList one by one. 
			try { 
				mAccList.add(new Double(m));
			} catch (IllegalStateException e) {
				// Exception happens when reach the capacity. 
				// Doubling the buffer. ListBlockingQueue has no such issue, 
				// But generally has worse performance 
				ArrayBlockingQueue<Double> newBuf = new ArrayBlockingQueue<Double>(
				mAccList = newBuf;
				mAccList.add(new Double(m));
Stop searching for code, let great code find you!  Add Codota to your java IDE