@Override public E removeLast() { synchronized (mutex) { return delegate().removeLast(); } }
create().offerLast("e"); create().removeFirst(); create().removeLast(); create().pollFirst(); create().pollLast();
@Override public E removeLast() { synchronized (mutex) { return delegate().removeLast(); } }
private String removeLast() { lock.lock(); try { final String removedKey = queue.removeLast(); return removedKey; } finally { lock.unlock(); } }
@Override public E removeLast() { synchronized (mutex) { return delegate().removeLast(); } }
public static <V> V removeLast(Deque<V> queue) { if (queue instanceof BTraceDeque || queue.getClass().getClassLoader() == null) { return queue.removeLast(); } else { throw new IllegalArgumentException(); } }
if (topConcat.metaIterators != null) { while (!topConcat.metaIterators.isEmpty()) { this.metaIterators.addFirst(topConcat.metaIterators.removeLast());
@CanIgnoreReturnValue @Override public E removeLast() { return delegate().removeLast(); }
@Override public E removeLast() { assertTrue(Thread.holdsLock(mutex)); return delegate.removeLast(); }
public Map<K, V> rotate() { Map<K, V> dead = buckets.removeLast(); if (isSingleThread) { buckets.addFirst(new HashMap<K, V>()); } else { buckets.addFirst(new ConcurrentHashMap<K, V>()); } if (callback != null) { for (Entry<K, V> entry : dead.entrySet()) { callback.expire(entry.getKey(), entry.getValue()); } } return dead; }
@CanIgnoreReturnValue @Override public E removeLast() { return delegate().removeLast(); }
private void processColorCode(char c) { if (c == FontColor.getReset()) { if (!previousColors.isEmpty()) { currentColor = previousColors.removeLast(); } } else { previousColors.addLast(currentColor); currentColor = FontColor.toColor(c); } }
/** * An analogue of {@link java.util.function.DoubleFunction} also accepting an index. * * <p>This interface is only intended for use by callers of {@link #mapWithIndex(DoubleStream, * DoubleFunctionWithIndex)}. * * @since 21.0 */ @Beta public interface DoubleFunctionWithIndex<R> { /** Applies this function to the given argument and its index within a stream. */ R apply(double from, long index); }
@CanIgnoreReturnValue @Override public E removeLast() { return delegate().removeLast(); }
@Override public void setHUDVisible(boolean visible) { if (visible) { if (!isHUDVisible()) { screens.addLast(hudScreenLayer); } } else { if (isHUDVisible()) { screens.removeLast(); } } }
/** * An analogue of {@link java.util.function.DoubleFunction} also accepting an index. * * <p>This interface is only intended for use by callers of {@link #mapWithIndex(DoubleStream, * DoubleFunctionWithIndex)}. * * @since 21.0 */ @Beta public interface DoubleFunctionWithIndex<R> { /** Applies this function to the given argument and its index within a stream. */ R apply(double from, long index); }
/** * An analogue of {@link java.util.function.DoubleFunction} also accepting an index. * * <p>This interface is only intended for use by callers of {@link #mapWithIndex(DoubleStream, * DoubleFunctionWithIndex)}. * * @since 21.0 */ @Beta public interface DoubleFunctionWithIndex<R> { /** Applies this function to the given argument and its index within a stream. */ R apply(double from, long index); }
private void applyCinematicEffect() { previousPositions.addFirst(new Vector3f(position)); previousViewingDirections.addFirst(new Vector3f(viewingDirection)); CameraSetting cameraSetting = cameraSettings.getCameraSetting(); while (previousPositions.size() > cameraSetting.getSmoothingFrames()) { previousPositions.removeLast(); previousViewingDirections.removeLast(); } position.set(calculateVector(previousPositions)); viewingDirection.set(calculateVector(previousViewingDirections)); }
private static void populateSequences( List<List<Long>> possibleSequences, Deque<Long> currentSequence, int current, int max, int maxDepth ) { possibleSequences.add(new ArrayList<>(currentSequence)); if (currentSequence.size() == maxDepth) { return; } for (int i = current; i < max; i++) { currentSequence.addLast((long) i); populateSequences(possibleSequences, currentSequence, i, max, maxDepth); currentSequence.removeLast(); } }
@Override public void leaveToken(DetailAST ast) { if (isOverridingMethod(ast)) { final MethodNode methodNode = methodStack.removeLast(); if (!methodNode.isCallingSuper()) { final DetailAST methodAST = methodNode.getMethod(); final DetailAST nameAST = methodAST.findFirstToken(TokenTypes.IDENT); log(nameAST, MSG_KEY, nameAST.getText()); } } }