m865.simulation
Class ButtonSystem

java.lang.Object
  extended by m865.simulation.ButtonSystem

public class ButtonSystem
extends java.lang.Object

Maintains the status of the buttons on each floor. The status of each button can be queried, set/reset.


Constructor Summary
ButtonSystem(DepartmentStore store)
          Constructor for objects of class ButtonSystem
 
Method Summary
 boolean getButtonStatus(int floor, int direction)
          Gets the status of a button at a floor
 void resetButton(int floor, int direction)
          Resets(Removes) "Press" status for a button at a floor
 void setButton(int floor, int direction)
          Sets "Press" status for a button at a floor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ButtonSystem

public ButtonSystem(DepartmentStore store)
Constructor for objects of class ButtonSystem

Method Detail

setButton

public void setButton(int floor,
                      int direction)
Sets "Press" status for a button at a floor

Parameters:
floor - Floor number (starts with 1)
direction - Up Button or Down Button (0 -> Up, 1 -> Down)

resetButton

public void resetButton(int floor,
                        int direction)
Resets(Removes) "Press" status for a button at a floor

Parameters:
floor - Floor number (starts with 1)
direction - Up Button or Down Button (0 -> Up, 1 -> Down)

getButtonStatus

public boolean getButtonStatus(int floor,
                               int direction)
Gets the status of a button at a floor

Parameters:
floor - Floor number (starts with 1)
direction - Up Button or Down Button (0 -> Up, 1 -> Down)
Returns:
status Pressed or Not (false -> Not Pressed, true -> Pressed)