public interface BlockingStack<N> extends Stack<N>
| Modifier and Type | Method and Description |
|---|---|
N |
pop(long time,
TimeUnit unit)
Pop an element from the stack, waiting if necessary if the stack is currently empty
|
N |
popInterruptibly()
Pop an element from the stack, waiting as long as required for an element to become available on the
stack
|
boolean |
push(N n,
long time,
TimeUnit unit)
Push an element on the stack, waiting if necessary if the stack is currently full
|
void |
pushInterruptibly(N n)
Push an element on the stack waiting as long as required for space to become available
|
boolean push(N n, long time, TimeUnit unit) throws InterruptedException
n - - the element to push on the stacktime - - the maximum time to waitunit - - unit of waiting timeInterruptedException - on interruptvoid pushInterruptibly(N n) throws InterruptedException
n - - the element to pushInterruptedException - - in the event the current thread is interrupted prior to pushing the elementN pop(long time, TimeUnit unit) throws InterruptedException
time - - the maximum time to waitunit - - the time unit for the waiting timeInterruptedException - on interruptN popInterruptibly() throws InterruptedException
InterruptedException - - in the event the current thread is interrupted prior to popping any elementCopyright © 2012–2018 Conversant Engineering. All rights reserved.