com.levigo.util.concurrent.tasks.applet
Class AppletPriorityBlockingQueue<E>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractQueue<E>
          extended by com.levigo.util.concurrent.tasks.applet.AppletPriorityBlockingQueue<E>
All Implemented Interfaces:
Iterable<E>, Collection<E>, BlockingQueue<E>, Queue<E>

public class AppletPriorityBlockingQueue<E>
extends AbstractQueue<E>
implements BlockingQueue<E>


Nested Class Summary
static class AppletPriorityBlockingQueue.QueueDestroyedException
           
 
Constructor Summary
AppletPriorityBlockingQueue()
           
AppletPriorityBlockingQueue(Collection<? extends E> c)
           
AppletPriorityBlockingQueue(int initialCapacity)
           
AppletPriorityBlockingQueue(int initialCapacity, Comparator<? super E> comparator)
           
 
Method Summary
 boolean add(E e)
           
 void clear()
           
 Comparator<? super E> comparator()
           
 boolean contains(Object o)
           
 int drainTo(Collection<? super E> c)
           
 int drainTo(Collection<? super E> c, int maxElements)
           
 Iterator<E> iterator()
           
 void kill()
          Basically does what the name suggests.
 boolean offer(E e)
           
 boolean offer(E e, long timeout, TimeUnit unit)
           
 E peek()
           
 E poll()
           
 E poll(long timeout, TimeUnit unit)
           
 void put(E e)
           
 int remainingCapacity()
           
 boolean remove(Object o)
           
 int size()
           
 E take()
           
 Object[] toArray()
           
<T> T[]
toArray(T[] a)
           
 String toString()
           
 
Methods inherited from class java.util.AbstractQueue
addAll, element, remove
 
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Queue
element, remove
 
Methods inherited from interface java.util.Collection
addAll, containsAll, equals, hashCode, isEmpty, removeAll, retainAll
 

Constructor Detail

AppletPriorityBlockingQueue

public AppletPriorityBlockingQueue()

AppletPriorityBlockingQueue

public AppletPriorityBlockingQueue(Collection<? extends E> c)

AppletPriorityBlockingQueue

public AppletPriorityBlockingQueue(int initialCapacity)

AppletPriorityBlockingQueue

public AppletPriorityBlockingQueue(int initialCapacity,
                                   Comparator<? super E> comparator)
Method Detail

add

public boolean add(E e)
Specified by:
add in interface Collection<E>
Specified by:
add in interface BlockingQueue<E>
Specified by:
add in interface Queue<E>
Overrides:
add in class AbstractQueue<E>

clear

public void clear()
Specified by:
clear in interface Collection<E>
Overrides:
clear in class AbstractQueue<E>

comparator

public Comparator<? super E> comparator()

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection<E>
Specified by:
contains in interface BlockingQueue<E>
Overrides:
contains in class AbstractCollection<E>

drainTo

public int drainTo(Collection<? super E> c)
Specified by:
drainTo in interface BlockingQueue<E>

drainTo

public int drainTo(Collection<? super E> c,
                   int maxElements)
Specified by:
drainTo in interface BlockingQueue<E>

iterator

public Iterator<E> iterator()
Specified by:
iterator in interface Iterable<E>
Specified by:
iterator in interface Collection<E>
Specified by:
iterator in class AbstractCollection<E>

kill

public void kill()
Basically does what the name suggests. Kill everyone that would like to access the queue. Take no hostages! This method should be used if worker threads remain in memory after an applet reload.


offer

public boolean offer(E e)
Specified by:
offer in interface BlockingQueue<E>
Specified by:
offer in interface Queue<E>

offer

public boolean offer(E e,
                     long timeout,
                     TimeUnit unit)
Specified by:
offer in interface BlockingQueue<E>

peek

public E peek()
Specified by:
peek in interface Queue<E>

poll

public E poll()
Specified by:
poll in interface Queue<E>

poll

public E poll(long timeout,
              TimeUnit unit)
       throws InterruptedException
Specified by:
poll in interface BlockingQueue<E>
Throws:
InterruptedException

put

public void put(E e)
Specified by:
put in interface BlockingQueue<E>

remainingCapacity

public int remainingCapacity()
Specified by:
remainingCapacity in interface BlockingQueue<E>

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection<E>
Specified by:
remove in interface BlockingQueue<E>
Overrides:
remove in class AbstractCollection<E>

size

public int size()
Specified by:
size in interface Collection<E>
Specified by:
size in class AbstractCollection<E>

take

public E take()
       throws InterruptedException
Specified by:
take in interface BlockingQueue<E>
Throws:
InterruptedException

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection<E>
Overrides:
toArray in class AbstractCollection<E>

toArray

public <T> T[] toArray(T[] a)
Specified by:
toArray in interface Collection<E>
Overrides:
toArray in class AbstractCollection<E>

toString

public String toString()
Overrides:
toString in class AbstractCollection<E>


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.