本文整理了Java中java.util.Deque.removeFirstOccurrence()
方法的一些代码示例,展示了Deque.removeFirstOccurrence()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Deque.removeFirstOccurrence()
方法的具体详情如下:
包路径:java.util.Deque
类名称:Deque
方法名:removeFirstOccurrence
[英]Removes the first occurrence of the specified element from this deque. If the deque does not contain the element, it is unchanged. More formally, removes the first 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 removeFirstOccurrence(Object o) {
synchronized (mutex) {
return delegate().removeFirstOccurrence(o);
}
}
代码示例来源:origin: btraceio/btrace
@Override
public synchronized boolean removeFirstOccurrence(Object o) {
return delegate.removeFirstOccurrence(o);
}
代码示例来源:origin: google/guava
@Override
public boolean removeFirstOccurrence(Object o) {
synchronized (mutex) {
return delegate().removeFirstOccurrence(o);
}
}
代码示例来源:origin: json-path/JsonPath
private void removeFirstOccurrence(String key) {
lock.lock();
try {
queue.removeFirstOccurrence(key);
} finally {
lock.unlock();
}
}
代码示例来源:origin: json-path/JsonPath
private void removeThenAddKey(String key) {
lock.lock();
try {
queue.removeFirstOccurrence(key);
queue.addFirst(key);
} finally {
lock.unlock();
}
}
代码示例来源:origin: prestodb/presto
@Override
public boolean removeFirstOccurrence(Object o) {
synchronized (mutex) {
return delegate().removeFirstOccurrence(o);
}
}
代码示例来源:origin: google/guava
@CanIgnoreReturnValue
@Override
public boolean removeFirstOccurrence(Object o) {
return delegate().removeFirstOccurrence(o);
}
代码示例来源:origin: google/guava
@Override
public boolean removeFirstOccurrence(Object o) {
assertTrue(Thread.holdsLock(mutex));
return delegate.removeFirstOccurrence(o);
}
代码示例来源:origin: apache/ignite
/** {@inheritDoc} */
@Override public boolean removeFirstOccurrence(Object o) {
boolean res = deque.removeFirstOccurrence(o);
if (res)
adder.decrement();
return res;
}
代码示例来源:origin: wildfly/wildfly
@Override
public boolean removeFirstOccurrence(Object o) {
synchronized (mutex) {
return delegate().removeFirstOccurrence(o);
}
}
代码示例来源:origin: prestodb/presto
@CanIgnoreReturnValue
@Override
public boolean removeFirstOccurrence(Object o) {
return delegate().removeFirstOccurrence(o);
}
代码示例来源:origin: google/j2objc
@CanIgnoreReturnValue
@Override
public boolean removeFirstOccurrence(Object o) {
return delegate().removeFirstOccurrence(o);
}
代码示例来源:origin: wildfly/wildfly
@CanIgnoreReturnValue
@Override
public boolean removeFirstOccurrence(Object o) {
return delegate().removeFirstOccurrence(o);
}
代码示例来源:origin: Netflix/concurrency-limits
} catch (InterruptedException e) {
synchronized (lock) {
backlog.removeFirstOccurrence(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().peekFirst();
create().peekLast();
create().removeFirstOccurrence("e");
create().removeLastOccurrence("e");
create().push("e");
代码示例来源:origin: com.jayway.jsonpath/json-path
private void removeFirstOccurrence(String key) {
lock.lock();
try {
queue.removeFirstOccurrence(key);
} finally {
lock.unlock();
}
}
代码示例来源:origin: jankotek/mapdb
assertIteratorExhausted(d.descendingIterator());
d.descendingIterator().forEachRemaining(alwaysThrows);
assertFalse(d.removeFirstOccurrence(bomb()));
assertFalse(d.removeLastOccurrence(bomb()));
代码示例来源:origin: com.jayway.jsonpath/json-path
private void removeThenAddKey(String key) {
lock.lock();
try {
queue.removeFirstOccurrence(key);
queue.addFirst(key);
} finally {
lock.unlock();
}
}
代码示例来源:origin: boonproject/boon
/**
* This removes the item from the queue and then re-adds it to increment the
* live-ness of the item. It updates the LRU since this key was read.
*
* @param key key
*/
private void removeThenAddKey( KEY key ) {
queue.removeFirstOccurrence( key );
queue.addFirst( key );
}
内容来源于网络,如有侵权,请联系作者删除!