public class LinkedBlockingMultiQueue.SubQueue extends AbstractOfferable<E>
Modifier and Type | Method and Description |
---|---|
void |
clear()
Atomically removes all of the elements from this queue.
|
boolean |
contains(Object o) |
void |
enable(boolean status)
Enable or disable this sub-queue.
|
boolean |
isEmpty()
Return whether the queue is empty.
|
boolean |
isEnabled()
Returns whether this sub-queue is enabled
|
Iterator<E> |
iterator()
Returns an iterator over the elements in this queue in proper sequence.
|
boolean |
offer(E e)
Inserts the specified element into this queue if it is possible to do so immediately without violating capacity
restrictions.
|
boolean |
offer(E e,
long timeout,
TimeUnit unit)
Inserts the specified element into this queue, waiting up to the specified wait time if necessary for space to
become available.
|
void |
put(E e)
Inserts the specified element into this queue, waiting if necessary for space to become available.
|
int |
remainingCapacity()
Returns the number of additional elements that this queue can ideally (in the absence of memory or resource
constraints) accept without blocking, or
Integer.MAX_VALUE if there is no intrinsic limit. |
boolean |
remove(Object o) |
int |
size()
Return the number of elements in this sub queue.
|
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
String |
toString() |
add, addAll
containsAll, removeAll, retainAll
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
equals, hashCode, parallelStream, removeIf, spliterator, stream
public int remainingCapacity()
Offerable
Integer.MAX_VALUE
if there is no intrinsic limit.
Note that you cannot always tell if an attempt to insert an element will succeed by inspecting
remainingCapacity
because it may be the case that another thread is about to insert or remove an element.
public void clear()
clear
in interface Collection<E>
clear
in class AbstractCollection<E>
public void enable(boolean status)
status
- true to enable, false to disablepublic boolean isEnabled()
public int size()
size
in interface Collection<E>
size
in class AbstractCollection<E>
public boolean isEmpty()
isEmpty
in interface Collection<E>
isEmpty
in class AbstractCollection<E>
public void put(E e) throws InterruptedException
Offerable
e
- the element to addInterruptedException
- if interrupted while waitingpublic boolean offer(E e, long timeout, TimeUnit unit) throws InterruptedException
Offerable
e
- the element to addtimeout
- how long to wait before giving up, in units of unit
unit
- a TimeUnit
determining how to interpret the timeout
parametertrue
if successful, or false
if the specified waiting time elapses before space is
availableInterruptedException
- if interrupted while waitingpublic boolean offer(E e)
Offerable
Offerable.add(E)
, which
can fail to insert an element only by throwing an exception.e
- the element to addtrue
if the element was added to this queue, else false
public boolean remove(Object o)
remove
in interface Collection<E>
remove
in class AbstractCollection<E>
public boolean contains(Object o)
contains
in interface Collection<E>
contains
in class AbstractCollection<E>
public String toString()
toString
in class AbstractCollection<E>
public Object[] toArray()
toArray
in interface Collection<E>
toArray
in class AbstractCollection<E>
public <T> T[] toArray(T[] a)
toArray
in interface Collection<E>
toArray
in class AbstractCollection<E>
public Iterator<E> iterator()
The returned iterator is weakly consistent.
iterator
in interface Iterable<E>
iterator
in interface Collection<E>
iterator
in class AbstractCollection<E>
Copyright © 2016 Internet2. All rights reserved.