DeliveryRobot
Class DeliveryRobot

DeliveryRobot.DeliveryRobot

public class DeliveryRobot

This class implements a delivery robot, which is capable of keeping track of how how much it should collect for a delivery, in addition to the normal Robot capabilities. This particular class is also a JavaDoc example.


Constructor Summary
DeliveryRobot(DeliveryRobot.City acity, int ave, int street, int direction)
          Creates a robot with no beepers and a default cost per move.
DeliveryRobot(DeliveryRobot.City acity, int avenue, int street, int direction, double moveCost)
          Creates a robot with no beepers and a predefined cost per move.
DeliveryRobot(DeliveryRobot.City acity, int avenue, int street, int direction, double moveCost, int numThings)
          Creates a robot with an initial number of beepers and a default cost per move.
DeliveryRobot(DeliveryRobot.City acity, int avenue, int street, int direction, int numThings)
          Creates a robot with an initial number of beepers and a default cost per move.
 
Method Summary
 double getFee()
          Returns the robot's fee for the distance it has moved so far.
 void move()
          Moves the robot forward one square.
 void reset()
          Reset the number of moves by this robot to 0.
 

Constructor Detail

DeliveryRobot

public DeliveryRobot(DeliveryRobot.City acity,
                     int ave,
                     int street,
                     int direction)
Creates a robot with no beepers and a default cost per move.

DeliveryRobot

public DeliveryRobot(DeliveryRobot.City acity,
                     int avenue,
                     int street,
                     int direction,
                     int numThings)
Creates a robot with an initial number of beepers and a default cost per move.
Parameters:
numBeepers - The number of beepers this robot begins with.

DeliveryRobot

public DeliveryRobot(DeliveryRobot.City acity,
                     int avenue,
                     int street,
                     int direction,
                     double moveCost)
Creates a robot with no beepers and a predefined cost per move.
Parameters:
moveCost - The cost of moving this robot one square.

DeliveryRobot

public DeliveryRobot(DeliveryRobot.City acity,
                     int avenue,
                     int street,
                     int direction,
                     double moveCost,
                     int numThings)
Creates a robot with an initial number of beepers and a default cost per move.
Parameters:
numBeepers - The number of beepers this robot begins with.
moveCost - The cost of moving this robot one square.
Method Detail

move

public void move()
Moves the robot forward one square.

getFee

public double getFee()
Returns the robot's fee for the distance it has moved so far.
Returns:
The robot's fee, calculated as cost per move times number of moves.

reset

public void reset()
Reset the number of moves by this robot to 0.