public class ProductionLine
extends java.lang.Object
| Modifier and Type | Field | Description |
|---|---|---|
private java.util.Queue<Disk> |
input |
A Queue of Disks that represent the input being fed into the production line
|
private java.util.Queue<Tower> |
output |
A Queue of Towers that represent the output of the production line.
|
private Tower |
robotArm |
A Tower representing the Disks that the robot arm is currently holding
|
| Constructor | Description |
|---|---|
ProductionLine() |
Constructs a ProductionLine object by creating default LinkedLists
for the input and output lines and creating the default Tower for the
ProductionLine's robot arm
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addDisk(Disk d) |
Adds a disk to the input of the ProductionLine
|
void |
process() |
Processes through the input line of Disks.
|
Tower |
removeTower() |
Removes a Tower from the output Queue
|
void |
unloadRobot() |
Flips the Tower of Disks currently held by the robot arm and places it
on the output line.
|
private java.util.Queue<Disk> input
private java.util.Queue<Tower> output
private Tower robotArm
public ProductionLine()
public void addDisk(Disk d)
d - the Disk to be added to the input line of production linepublic void unloadRobot()
public void process()
public Tower removeTower()