interfaces
Interface ElevatorForController

All Known Subinterfaces:
ElevatorSpecification
All Known Implementing Classes:
Elevator

public interface ElevatorForController

The interface provided by the Elevator to the Controller allowing it to read the current state of the elevator system (see ElevatorSpecification)

Version:
1
Author:
J Paul Gibson

Method Summary
 Direction currentDirection()
           
 int currentFloor()
           
 boolean downPressedAtFloor(int floor)
          Permits elevator controller to see if a request to go down has been made at a specified floor
 boolean floorPressedInElevator(int floor)
          Permits elevator controller to see if there is a request to a particular floor
 boolean noMoreRequestsAbove(int floor)
           
 boolean noMoreRequestsBelow(int floor)
           
 int topFloor()
           
 boolean upPressedAtFloor(int floor)
          Permits elevator controller to see if a request to go up has been made at a specified floor
 

Method Detail

currentDirection

Direction currentDirection()
Returns:
the current direction in which the elevator is moving

currentFloor

int currentFloor()
Returns:
the current floor of the elevator

downPressedAtFloor

boolean downPressedAtFloor(int floor)
                           throws java.lang.IllegalArgumentException
Permits elevator controller to see if a request to go down has been made at a specified floor

Parameters:
floor - specifies the floor at which the request is being checked
Throws:
java.lang.IllegalArgumentException - if the floor is not valid (from 1.. NUMBER_OF_FLOORS-1)

floorPressedInElevator

boolean floorPressedInElevator(int floor)
                               throws java.lang.IllegalArgumentException
Permits elevator controller to see if there is a request to a particular floor

Returns:
Whether there is currently a request to go to the specified floor (inside the elevator)
Throws:
java.lang.IllegalArgumentException - if the number of floors specified is not in range

noMoreRequestsAbove

boolean noMoreRequestsAbove(int floor)
                            throws java.lang.IllegalArgumentException
Parameters:
floor -
Returns:
whether there is a request for a floor (inside the elevator) above the specified floor
Throws:
java.lang.IllegalArgumentException - if the number of floors specified is not in range

noMoreRequestsBelow

boolean noMoreRequestsBelow(int floor)
                            throws java.lang.IllegalArgumentException
Parameters:
floor -
Returns:
whether there is a request for a floor (inside the elevator) above the specified floor
Throws:
java.lang.IllegalArgumentException - if the number of floors specified is not in range

topFloor

int topFloor()
Returns:
the number of the top floor

upPressedAtFloor

boolean upPressedAtFloor(int floor)
                         throws java.lang.IllegalArgumentException
Permits elevator controller to see if a request to go up has been made at a specified floor

Parameters:
floor - specifies the floor at which the request is being checked
Throws:
java.lang.IllegalArgumentException - if the floor is not valid (from 0.. NUMBER_OF_FLOORS-2)