java.util.Deque.removeLastOccurrence()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(3.9k)|赞(0)|评价(0)|浏览(196)

本文整理了Java中java.util.Deque.removeLastOccurrence()方法的一些代码示例,展示了Deque.removeLastOccurrence()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Deque.removeLastOccurrence()方法的具体详情如下:
包路径:java.util.Deque
类名称:Deque
方法名:removeLastOccurrence

Deque.removeLastOccurrence介绍

[英]Removes the last occurrence of the specified element from this deque. If the deque does not contain the element, it is unchanged. More formally, removes the last element e such that (o==null ? e==null : o.equals(e)) (if such an element exists). Returns true if this deque contained the specified element (or equivalently, if this deque changed as a result of the call).
[中]从此数据集中删除指定元素的最后一个匹配项。如果deque不包含该元素,则该元素将保持不变。更正式地说,删除最后一个元素e,这样(o==null?e==null:o.equals(e))(如果存在这样的元素)。如果此deque包含指定的元素,则返回true(或者如果此deque因调用而更改,则返回等效值)。

代码示例

代码示例来源:origin: google/j2objc

@Override
public boolean removeLastOccurrence(Object o) {
 synchronized (mutex) {
  return delegate().removeLastOccurrence(o);
 }
}

代码示例来源:origin: btraceio/btrace

@Override
public synchronized boolean removeLastOccurrence(Object o) {
  return delegate.removeLastOccurrence(o);
}

代码示例来源:origin: google/guava

@Override
public boolean removeLastOccurrence(Object o) {
 synchronized (mutex) {
  return delegate().removeLastOccurrence(o);
 }
}

代码示例来源:origin: prestodb/presto

@Override
public boolean removeLastOccurrence(Object o) {
 synchronized (mutex) {
  return delegate().removeLastOccurrence(o);
 }
}

代码示例来源:origin: google/guava

@Override
public boolean removeLastOccurrence(Object o) {
 assertTrue(Thread.holdsLock(mutex));
 return delegate.removeLastOccurrence(o);
}

代码示例来源:origin: google/guava

@CanIgnoreReturnValue
 @Override
 public boolean removeLastOccurrence(Object o) {
  return delegate().removeLastOccurrence(o);
 }
}

代码示例来源:origin: google/guava

boolean removed =
  (workerRunningState == IDLE || workerRunningState == QUEUING)
    && queue.removeLastOccurrence(submittedTask);

代码示例来源:origin: apache/ignite

/** {@inheritDoc} */
@Override public boolean removeLastOccurrence(Object o) {
  boolean res = deque.removeLastOccurrence(o);
  if (res)
    adder.decrement();
  return res;
}

代码示例来源:origin: wildfly/wildfly

@Override
public boolean removeLastOccurrence(Object o) {
 synchronized (mutex) {
  return delegate().removeLastOccurrence(o);
 }
}

代码示例来源:origin: prestodb/presto

@CanIgnoreReturnValue
 @Override
 public boolean removeLastOccurrence(Object o) {
  return delegate().removeLastOccurrence(o);
 }
}

代码示例来源:origin: google/j2objc

@CanIgnoreReturnValue
 @Override
 public boolean removeLastOccurrence(Object o) {
  return delegate().removeLastOccurrence(o);
 }
}

代码示例来源:origin: google/j2objc

boolean removed =
  (workerRunningState == IDLE || workerRunningState == QUEUING)
    && queue.removeLastOccurrence(submittedTask);

代码示例来源:origin: prestodb/presto

boolean removed =
  (workerRunningState == IDLE || workerRunningState == QUEUING)
    && queue.removeLastOccurrence(submittedTask);

代码示例来源:origin: wildfly/wildfly

@CanIgnoreReturnValue
 @Override
 public boolean removeLastOccurrence(Object o) {
  return delegate().removeLastOccurrence(o);
 }
}

代码示例来源:origin: wildfly/wildfly

boolean removed =
  (workerRunningState == IDLE || workerRunningState == QUEUING)
    && queue.removeLastOccurrence(submittedTask);

代码示例来源:origin: Netflix/concurrency-limits

backlog.removeLastOccurrence(event);

代码示例来源:origin: jankotek/mapdb

/**
 * remove(null), contains(null) always return false
 */
public void testNeverContainsNull() {
  Deque<?>[] qs = {
    new LinkedBlockingDeque<Object>(),
    populatedDeque(2),
  };
  for (Deque<?> q : qs) {
    assertFalse(q.contains(null));
    assertFalse(q.remove(null));
    assertFalse(q.removeFirstOccurrence(null));
    assertFalse(q.removeLastOccurrence(null));
  }
}

代码示例来源:origin: google/guava

create().peekLast();
create().removeFirstOccurrence("e");
create().removeLastOccurrence("e");
create().push("e");
create().pop();

代码示例来源:origin: jankotek/mapdb

d.descendingIterator().forEachRemaining(alwaysThrows);
assertFalse(d.removeFirstOccurrence(bomb()));
assertFalse(d.removeLastOccurrence(bomb()));

代码示例来源:origin: org.apache.hbase.thirdparty/hbase-shaded-miscellaneous

@Override
public boolean removeLastOccurrence(Object o) {
 synchronized (mutex) {
  return delegate().removeLastOccurrence(o);
 }
}

相关文章