fr.ifremer.isisfish.simulator.launcher
Class SimulationQueue

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractQueue<E>
          extended by fr.ifremer.isisfish.simulator.launcher.JDKPriorityBlockingQueue<SimulationJob>
              extended by fr.ifremer.isisfish.simulator.launcher.SimulationQueue
All Implemented Interfaces:
Serializable, Iterable<SimulationJob>, Collection<SimulationJob>, BlockingQueue<SimulationJob>, Queue<SimulationJob>

public class SimulationQueue
extends JDKPriorityBlockingQueue<SimulationJob>

Multi tail PriorityBlockingQueue.

Version:
$Revision: 2741 $ Last update : $Date: 2009-11-05 15:29:02 +0100 (jeu., 05 nov. 2009) $ By : $Author: chatellier $
Author:
poussin
See Also:
Serialized Form

Field Summary
protected  List<SimulationQueue> childs
           
protected  SimulationQueue parent
           
 
Fields inherited from class fr.ifremer.isisfish.simulator.launcher.JDKPriorityBlockingQueue
lock, notEmpty, q
 
Constructor Summary
SimulationQueue()
           
SimulationQueue(SimulationQueue parent)
           
 
Method Summary
 void addChild(SimulationQueue c)
           
 boolean offer(SimulationJob e)
          Inserts the specified element into this priority queues.
 SimulationJob peek()
           
 SimulationJob poll()
           
 SimulationJob poll(long timeout, TimeUnit unit)
           
 boolean remove(Object o)
          Removes a single instance of the specified element from this queues, if it is present.
 SimulationJob take()
           
 
Methods inherited from class fr.ifremer.isisfish.simulator.launcher.JDKPriorityBlockingQueue
add, clear, comparator, contains, drainTo, drainTo, iterator, offer, put, remainingCapacity, size, toArray, toArray, 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
 

Field Detail

parent

protected SimulationQueue parent

childs

protected List<SimulationQueue> childs
Constructor Detail

SimulationQueue

public SimulationQueue()

SimulationQueue

public SimulationQueue(SimulationQueue parent)
Method Detail

addChild

public void addChild(SimulationQueue c)

remove

public boolean remove(Object o)
Description copied from class: JDKPriorityBlockingQueue
Removes a single instance of the specified element from this queues, if it is present. More formally, removes an element e such that o.equals(e), if this queues contains one or more such elements. Returns true if and only if this queues contained the specified element (or equivalently, if this queues changed as a result of the call).

Specified by:
remove in interface Collection<SimulationJob>
Specified by:
remove in interface BlockingQueue<SimulationJob>
Overrides:
remove in class JDKPriorityBlockingQueue<SimulationJob>
Parameters:
o - element to be removed from this queues, if present
Returns:
true if this queues changed as a result of the call

offer

public boolean offer(SimulationJob e)
Description copied from class: JDKPriorityBlockingQueue
Inserts the specified element into this priority queues.

Specified by:
offer in interface BlockingQueue<SimulationJob>
Specified by:
offer in interface Queue<SimulationJob>
Overrides:
offer in class JDKPriorityBlockingQueue<SimulationJob>
Parameters:
e - the element to add
Returns:
true (as specified by Queue.offer(E))

peek

public SimulationJob peek()
Specified by:
peek in interface Queue<SimulationJob>
Overrides:
peek in class JDKPriorityBlockingQueue<SimulationJob>

poll

public SimulationJob poll()
Specified by:
poll in interface Queue<SimulationJob>
Overrides:
poll in class JDKPriorityBlockingQueue<SimulationJob>

take

public SimulationJob take()
                   throws InterruptedException
Specified by:
take in interface BlockingQueue<SimulationJob>
Overrides:
take in class JDKPriorityBlockingQueue<SimulationJob>
Throws:
InterruptedException

poll

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


Copyright © 1999-2010 CodeLutin. All Rights Reserved.