be.ac.ua.broker.input.tasks
Class WorkloadWM2

java.lang.Object
  extended by be.ac.ua.broker.input.tasks.WorkloadWM2
All Implemented Interfaces:
Workload, java.lang.Comparable<Workload>

public class WorkloadWM2
extends java.lang.Object
implements Workload

This class represents a workload of workload model two.

Author:
Vermeersch Kurt

Constructor Summary
WorkloadWM2(TaskSpecification spec)
          Constructor for WorkloadWM2
WorkloadWM2(TaskSpecification spec, java.util.List<java.util.List<SubTask>> part, int hoursTimeFrame)
          Constructor for WorkloadWM2
 
Method Summary
 void addTaskHour(SubTaskCollection coll)
          Add a subTaskCollection to the workload, it is automatically associated with the next task hour of the associated task
 int compareTo(Workload wl)
           
 java.util.Date getDeadline()
           
 int getHoursTimeFrame()
           
 int getLength()
           
 java.util.Date getStartDate()
           
 SubTaskCollection getTasksOnHour(int i)
          Getter for the subTaskCollection associated with a given task hour of the associated task
 TaskSpecification getTaskSpecification()
           
 java.util.List<java.util.List<SubTask>> getWorkload()
           
 int getWorkload(int j)
          Getter for the workload associated with a given task hour of the task
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WorkloadWM2

public WorkloadWM2(TaskSpecification spec)
Constructor for WorkloadWM2

Parameters:
spec - specification of the task the workload belongs to

WorkloadWM2

public WorkloadWM2(TaskSpecification spec,
                   java.util.List<java.util.List<SubTask>> part,
                   int hoursTimeFrame)
Constructor for WorkloadWM2

Parameters:
spec - specification of the task the workload belongs to
part - list of a collection of subTasks that belong to the workload
hoursTimeFrame - the number of hours between the start of the scheduling period and the deadline of the associated task
Method Detail

addTaskHour

public void addTaskHour(SubTaskCollection coll)
Add a subTaskCollection to the workload, it is automatically associated with the next task hour of the associated task

Parameters:
coll - the subTaskCollection to add

getTasksOnHour

public SubTaskCollection getTasksOnHour(int i)
Getter for the subTaskCollection associated with a given task hour of the associated task

Parameters:
i - the task hour to get the associated collection of subtasks for
Returns:
the subTaskCollection associated with given task hour

getWorkload

public java.util.List<java.util.List<SubTask>> getWorkload()
Returns:
the list of collections of subtasks that are associated with every task hour of the tasks

getHoursTimeFrame

public int getHoursTimeFrame()
Returns:
the number of hours between the start of the scheduling period and the deadline of the associated task

getLength

public int getLength()
Specified by:
getLength in interface Workload
Returns:
the length in hours of the task/workload

getStartDate

public java.util.Date getStartDate()
Specified by:
getStartDate in interface Workload
Returns:
the start time of the scheduling period of the associated task

getDeadline

public java.util.Date getDeadline()
Specified by:
getDeadline in interface Workload
Returns:
the deadline by which the workload has to be run

getTaskSpecification

public TaskSpecification getTaskSpecification()
Specified by:
getTaskSpecification in interface Workload
Returns:
the specification of the task to which the workload belongs

getWorkload

public int getWorkload(int j)
Description copied from interface: Workload
Getter for the workload associated with a given task hour of the task

Specified by:
getWorkload in interface Workload
Parameters:
j - the task hour to get the load for
Returns:
the load corresponding to the given task hour

compareTo

public int compareTo(Workload wl)
Specified by:
compareTo in interface java.lang.Comparable<Workload>