uk.ac.nott.cs.g54dia.library
Class Task

java.lang.Object
  extended by uk.ac.nott.cs.g54dia.library.Task

public class Task
extends java.lang.Object

A environment cell which contains an task


Field Summary
(package private)  boolean accepted
           
(package private)  boolean completed
           
(package private)  int demand
           
static int MAX_DEMAND
          The maximum size of a demand for water
(package private)  Station station
           
(package private)  int supplied
           
 
Constructor Summary
Task(Station s)
           
 
Method Summary
protected  void accept()
           
 int getRequired()
          How much water is required to complete the task?
 Point getStationPosition()
          Get the position of the station to which water should be delivered
 int getWaterDemand()
          Get the amount of water to be delivered to the station
 boolean isComplete()
          Is this task completed?
protected  void setWaterDemand(int d)
           
protected  void supply(int s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_DEMAND

public static final int MAX_DEMAND
The maximum size of a demand for water

See Also:
Constant Field Values

station

Station station

demand

int demand

supplied

int supplied

accepted

boolean accepted

completed

boolean completed
Constructor Detail

Task

Task(Station s)
Method Detail

getStationPosition

public Point getStationPosition()
Get the position of the station to which water should be delivered


getWaterDemand

public int getWaterDemand()
Get the amount of water to be delivered to the station


isComplete

public boolean isComplete()
Is this task completed?


getRequired

public int getRequired()
How much water is required to complete the task?


setWaterDemand

protected void setWaterDemand(int d)

accept

protected void accept()

supply

protected void supply(int s)