@Override public E poll() { if (isEmpty()) { return null; } return remove(); }
CircularFifoQueue.this.remove(); lastReturnedIndex = -1; return;
/** * Adds the given element to this queue. If the queue is full, the least recently added * element is discarded so that a new element can be inserted. * * @param element the element to add * @return true, always * @throws NullPointerException if the given element is null */ @Override public boolean add(final E element) { if (null == element) { throw new NullPointerException("Attempted to add null object to queue"); } if (isAtFullCapacity()) { remove(); } elements[end++] = element; if (end >= maxElements) { end = 0; } if (end == start) { full = true; } return true; }
public void flushToServer() { if (buffer.isEmpty()) { return; } List sent = new ArrayList(); try { synchronized (buffer) { while (!buffer.isEmpty()) { sent.add(buffer.remove()); } } StringBuilder result = new StringBuilder(); for (Object string : sent) { result.append(string); result.append("\n"); } consoleAppender.append(result.toString()); } catch (IOException e) { LOGGER.warn("Could not send console output to server", e); synchronized (buffer) { sent.addAll(buffer); buffer.clear(); buffer.addAll(sent); } } }
m_memoryQueue.remove();
@Override public E poll() { if (isEmpty()) { return null; } return remove(); }
CircularFifoQueue.this.remove(); lastReturnedIndex = -1; return;
/** * Adds the given element to this queue. If the queue is full, the least recently added * element is discarded so that a new element can be inserted. * * @param element the element to add * @return true, always * @throws NullPointerException if the given element is null */ @Override public boolean add(final E element) { if (null == element) { throw new NullPointerException("Attempted to add null object to queue"); } if (isAtFullCapacity()) { remove(); } elements[end++] = element; if (end >= maxElements) { end = 0; } if (end == start) { full = true; } return true; }
String command = ircCommandQueue.remove(); sendCommand(command);
if (connectionState.equals(TMIConnectionState.CONNECTED)) { String command = commandQueue.remove(); sendCommand(command);