public class MemoryLimitedLinkedBlockingQueue<E>
extends java.util.concurrent.LinkedBlockingQueue<E>
LinkedBlockingQueue.MemoryLimiter,
MemoryLimitCalculator,
序列化表格| 构造器和说明 |
|---|
MemoryLimitedLinkedBlockingQueue(java.util.Collection<? extends E> c,
long memoryLimit,
java.lang.instrument.Instrumentation inst) |
MemoryLimitedLinkedBlockingQueue(java.lang.instrument.Instrumentation inst) |
MemoryLimitedLinkedBlockingQueue(long memoryLimit,
java.lang.instrument.Instrumentation inst) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
clear() |
long |
getCurrentMemory()
get the current memory.
|
long |
getCurrentRemainMemory()
get the current remain memory.
|
long |
getMemoryLimit()
get the memory limit.
|
boolean |
offer(E e) |
boolean |
offer(E e,
long timeout,
java.util.concurrent.TimeUnit unit) |
E |
poll() |
E |
poll(long timeout,
java.util.concurrent.TimeUnit unit) |
void |
put(E e) |
boolean |
remove(java.lang.Object o) |
void |
setMemoryLimit(long memoryLimit)
set the memory limit.
|
E |
take() |
contains, drainTo, drainTo, iterator, peek, remainingCapacity, size, spliterator, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitpublic MemoryLimitedLinkedBlockingQueue(java.lang.instrument.Instrumentation inst)
public MemoryLimitedLinkedBlockingQueue(long memoryLimit,
java.lang.instrument.Instrumentation inst)
public MemoryLimitedLinkedBlockingQueue(java.util.Collection<? extends E> c, long memoryLimit, java.lang.instrument.Instrumentation inst)
public void setMemoryLimit(long memoryLimit)
memoryLimit - the memory limitpublic long getMemoryLimit()
public long getCurrentMemory()
public long getCurrentRemainMemory()
public void put(E e) throws java.lang.InterruptedException
public boolean offer(E e, long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
public boolean offer(E e)
public E take() throws java.lang.InterruptedException
public E poll(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
public E poll()
public boolean remove(java.lang.Object o)
Copyright © 2022 The Apache Software Foundation. All rights reserved.