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

java.lang.Object
  extended by org.jfree.data.gantt.Task
      extended by be.ac.ua.broker.input.tasks.SubTask
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, org.jfree.util.PublicCloneable
Direct Known Subclasses:
DummySubTask

public class SubTask
extends org.jfree.data.gantt.Task

This class represents a subtask which is used to represent a single task hour of a task, it is the smallest unit used during the scheduling phase of our broker process. During the allocation phase an actual time frame and corresponding price is associated with the sub task.

Author:
Vermeersch Kurt
See Also:
Serialized Form

Constructor Summary
SubTask(int hour, TaskSpecification spec)
          Constructor for SubTask
SubTask(java.lang.String desc)
          Constructor for SubTask
SubTask(SubTask subTask, java.util.Date time, java.util.Date time2)
          Constructor for SubTask
 
Method Summary
 java.util.Date getEndDate()
           
 Price getPrice()
           
 TaskSpecification getSpecification()
           
 java.util.Date getStartDate()
           
 int getTaskHour()
           
 boolean isDummy()
           
 boolean isSpotEnabled()
           
 void setPrice(Price price)
          Setter for the price associated with the subTask
 void setTimePeriod(java.util.Date startDate, java.util.Date endDate)
          Tag the subTask with the desired time period
 
Methods inherited from class org.jfree.data.gantt.Task
addSubtask, clone, equals, getDescription, getDuration, getPercentComplete, getSubtask, getSubtaskCount, removeSubtask, setDescription, setDuration, setPercentComplete, setPercentComplete
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubTask

public SubTask(int hour,
               TaskSpecification spec)
Constructor for SubTask

Parameters:
hour - the hour of the original task this subtask corresponds to.
spec - the specification of the original task this sub task is a part of

SubTask

public SubTask(java.lang.String desc)
Constructor for SubTask

Parameters:
desc - only a name is given to the subTask, this possibility is provided to bes able to generate dummy subTasks

SubTask

public SubTask(SubTask subTask,
               java.util.Date time,
               java.util.Date time2)
Constructor for SubTask

Parameters:
subTask - the subTask that is being tagged with a start and end time
time - the start time of the subTask
time2 - the end time of the subTask
Method Detail

getTaskHour

public int getTaskHour()
Returns:
the task hour of the task this sub task represents

getSpecification

public TaskSpecification getSpecification()
Returns:
the specification of the original task this sub task is a part of

setPrice

public void setPrice(Price price)
Setter for the price associated with the subTask

Parameters:
price - the price associated with the subTask

getPrice

public Price getPrice()
Returns:
the price associated with the subTask

isDummy

public boolean isDummy()
Returns:
whether the subTask is a dummy or it corresponds to an actual task hour of an existing task

isSpotEnabled

public boolean isSpotEnabled()
Returns:
whether the task this subTask is a part of is allowed to be run on spot instances

getStartDate

public java.util.Date getStartDate()
Returns:
the start time of the subTask

getEndDate

public java.util.Date getEndDate()
Returns:
the end time of the subTask

setTimePeriod

public void setTimePeriod(java.util.Date startDate,
                          java.util.Date endDate)
Tag the subTask with the desired time period

Parameters:
startDate - the start time of the subTask
endDate - the end timse of the subTask