本文整理了Java中java.util.ArrayDeque.clear()
方法的一些代码示例,展示了ArrayDeque.clear()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ArrayDeque.clear()
方法的具体详情如下:
包路径:java.util.ArrayDeque
类名称:ArrayDeque
方法名:clear
[英]Removes all of the elements from this deque. The deque will be empty after this call returns.
[中]从该数据集中删除所有元素。此调用返回后,deque将为空。
代码示例来源:origin: eclipse-vertx/vert.x
/**
* Clear the buffer synchronously.
* <p/>
* No handler will be called.
*
* @return a reference to this, so the API can be used fluently
*/
public synchronized InboundBuffer<E> clear() {
pending.clear();
return this;
}
代码示例来源:origin: apache/flink
@Override
public void cleanup() {
pendingCheckpoints.clear();
}
代码示例来源:origin: apache/flink
@Override
public void close() throws Exception {
idsForCurrentCheckpoint.clear();
pendingCheckpoints.clear();
}
代码示例来源:origin: ReactiveX/RxJava
@Override
public void onError(Throwable t) {
buffers.clear();
downstream.onError(t);
}
代码示例来源:origin: redisson/redisson
@Override
public void onError(Throwable t) {
buffers.clear();
actual.onError(t);
}
代码示例来源:origin: apache/incubator-druid
@Override
public void close()
{
objects.clear();
}
}
代码示例来源:origin: google/ExoPlayer
@Override
public void seek(long position, long timeUs) {
int trackCount = trackBundles.size();
for (int i = 0; i < trackCount; i++) {
trackBundles.valueAt(i).reset();
}
pendingMetadataSampleInfos.clear();
pendingMetadataSampleBytes = 0;
pendingSeekTimeUs = timeUs;
containerAtoms.clear();
enterReadingAtomHeaderState();
}
代码示例来源:origin: google/ExoPlayer
@Override
public void reset() {
elementState = ELEMENT_STATE_READ_ID;
masterElementsStack.clear();
varintReader.reset();
}
代码示例来源:origin: ReactiveX/RxJava
@Override
public void onComplete() {
if (done) {
return;
}
for (Processor<T, T> w : windows) {
w.onComplete();
}
windows.clear();
done = true;
drain();
}
代码示例来源:origin: ReactiveX/RxJava
@Override
public void onError(Throwable t) {
if (done) {
RxJavaPlugins.onError(t);
return;
}
done = true;
buffers.clear();
downstream.onError(t);
}
代码示例来源:origin: ReactiveX/RxJava
@Override
public void onNext(T t) {
if (index++ % skip == 0) {
U b;
try {
b = ObjectHelper.requireNonNull(bufferSupplier.call(), "The bufferSupplier returned a null collection. Null values are generally not allowed in 2.x operators and sources.");
} catch (Throwable e) {
buffers.clear();
upstream.dispose();
downstream.onError(e);
return;
}
buffers.offer(b);
}
Iterator<U> it = buffers.iterator();
while (it.hasNext()) {
U b = it.next();
b.add(t);
if (count <= b.size()) {
it.remove();
downstream.onNext(b);
}
}
}
代码示例来源:origin: redisson/redisson
@Override
public void onError(Throwable t) {
if (done) {
RxJavaPlugins.onError(t);
return;
}
done = true;
buffers.clear();
actual.onError(t);
}
代码示例来源:origin: redisson/redisson
@Override
public void onComplete() {
if (done) {
return;
}
for (Processor<T, T> w : windows) {
w.onComplete();
}
windows.clear();
done = true;
drain();
}
代码示例来源:origin: ReactiveX/RxJava
@Override
public void onError(Throwable t) {
if (done) {
RxJavaPlugins.onError(t);
return;
}
for (Processor<T, T> w : windows) {
w.onError(t);
}
windows.clear();
error = t;
done = true;
drain();
}
代码示例来源:origin: apache/pulsar
void internalFlushPendingMarkDeletes() {
MarkDeleteEntry lastEntry = pendingMarkDeleteOps.getLast();
lastEntry.callbackGroup = Lists.newArrayList(pendingMarkDeleteOps);
pendingMarkDeleteOps.clear();
internalMarkDelete(lastEntry);
}
代码示例来源:origin: google/ExoPlayer
@Override
public void seek(long position, long timeUs) {
containerAtoms.clear();
atomHeaderBytesRead = 0;
sampleTrackIndex = C.INDEX_UNSET;
sampleBytesWritten = 0;
sampleCurrentNalBytesRemaining = 0;
if (position == 0) {
enterReadingAtomHeaderState();
} else if (tracks != null) {
updateSampleIndices(timeUs);
}
}
代码示例来源:origin: apache/incubator-druid
void close()
{
synchronized (this) {
closed = true;
resourceHolderList.forEach(v -> factory.close(v.getResource()));
resourceHolderList.clear();
this.notifyAll();
}
}
}
代码示例来源:origin: hibernate/hibernate-orm
@Override
public void finish() {
propertyPathStack.pop();
MDC.remove( MDC_KEY );
fetchSourceStack.clear();
}
代码示例来源:origin: apache/flink
@Override
public void cleanup() throws IOException {
bufferBlocker.close();
if (currentBuffered != null) {
currentBuffered.cleanup();
}
for (BufferOrEventSequence seq : queuedBuffered) {
seq.cleanup();
}
queuedBuffered.clear();
numQueuedBytes = 0L;
}
代码示例来源:origin: redisson/redisson
@Override
public void onError(Throwable t) {
if (done) {
RxJavaPlugins.onError(t);
return;
}
for (Processor<T, T> w : windows) {
w.onError(t);
}
windows.clear();
error = t;
done = true;
drain();
}
内容来源于网络,如有侵权,请联系作者删除!