org.objectweb.proactive.scheduler
Class Queue

java.lang.Object
  extended by org.objectweb.proactive.scheduler.Queue
All Implemented Interfaces:
java.io.Serializable

public class Queue
extends java.lang.Object
implements java.io.Serializable

This is the class definition of the queue that shall be used to store the jobs to be started in a HashMap.

Author:
cjarjouh
See Also:
Serialized Form

Constructor Summary
Queue()
           
 
Method Summary
 boolean containsId(java.lang.String jobId)
          Search for a job by job Id.
 GenericJob get(java.lang.String jobId)
          returns the job associated with the job Id.
 boolean isEmpty()
          returns true if the queue is empty, false otherwise.
 java.util.Set keySet()
          Gives a list of the IDs of the waiting jobs.
 void put(GenericJob job)
          Inserts the job to the queue and give it an Id.
 GenericJob remove(java.lang.String jobId)
          removes and returns the job associated with the job Id from the queue.
 int size()
          Returns the number of the waiting jobs.
 java.util.Collection values()
          returns a collection of the genericJob description
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Queue

public Queue()
Method Detail

size

public int size()
Returns the number of the waiting jobs.

Returns:
the number of the waiting jobs.

containsId

public boolean containsId(java.lang.String jobId)
Search for a job by job Id.

Parameters:
Id - is the id of the job.
Returns:
true if the job exists, null otherwise.

put

public void put(GenericJob job)
         throws QueueFullException
Inserts the job to the queue and give it an Id.

Parameters:
job - contains the description of the job to be deployed.
Throws:
QueueFullException - whenever the queue is full.

keySet

public java.util.Set keySet()
Gives a list of the IDs of the waiting jobs.

Returns:
a set of all the keys

get

public GenericJob get(java.lang.String jobId)
returns the job associated with the job Id.

Parameters:
Id - is the Id of the job needed
Returns:
the description of the job associated with the job Id.

remove

public GenericJob remove(java.lang.String jobId)
removes and returns the job associated with the job Id from the queue.

Parameters:
Id - is the Id of the job needed
Returns:
the description of the job associated with the job Id.

isEmpty

public boolean isEmpty()
returns true if the queue is empty, false otherwise.

Returns:
true if the queue is empty, false otherwise.

values

public java.util.Collection values()
returns a collection of the genericJob description

Returns:
a collection of the genericJob description


Copyright 2001-2007 INRIA All Rights Reserved.