Class SaloonCar

java.lang.Object
  |
  +--Carriage
        |
        +--SaloonCar

class SaloonCar
extends Carriage

Class defines a saloon car.

Version:
1.0
Author:
CS211 - Spring 2000

Field Summary
static int AISLE_LEFT
          Window left seat type
static int AISLE_RIGHT
          Aisle right seat type
private static int NO_OF_SEATROWS_PER_SALOON_CAR
          Number of rows in a Saloon Car
private static int NO_OF_SEATS_PER_SEATROW
          Number of seats per row in a Saloon Car
static int SALOON_CAR_TYPE
          Saloon Car type
static int WINDOW_LEFT
          Window left seat type
static int WINDOW_RIGHT
          Window right seat type
 
Fields inherited from class Carriage
carriageNumber, carriagePlan, noOfColumns, noOfRows, noOfVacantPlaces
 
Constructor Summary
SaloonCar(int carriageNo)
          2a) Calls constructor of the superclass with carriage-number, etc.
 
Method Summary
 java.lang.String getNameOfTypePlace(int typePlace)
          2b) Defines the abstract method from the Carriage class.
 java.lang.String toString()
          2c) Overrides the method from the Object class.
 
Methods inherited from class Carriage
drawCarriagePlan, findRowNoOfFirstVacantPlace, getCarriageNo, hasVacantPlace, isFull, placePositionToPlaceNo, reserveFirstVacantPlace, setOccupied, typePlaceWithLeastOccupancy
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

SALOON_CAR_TYPE

public static final int SALOON_CAR_TYPE
Saloon Car type

NO_OF_SEATROWS_PER_SALOON_CAR

private static final int NO_OF_SEATROWS_PER_SALOON_CAR
Number of rows in a Saloon Car

NO_OF_SEATS_PER_SEATROW

private static final int NO_OF_SEATS_PER_SEATROW
Number of seats per row in a Saloon Car

WINDOW_LEFT

public static final int WINDOW_LEFT
Window left seat type

AISLE_LEFT

public static final int AISLE_LEFT
Window left seat type

AISLE_RIGHT

public static final int AISLE_RIGHT
Aisle right seat type

WINDOW_RIGHT

public static final int WINDOW_RIGHT
Window right seat type
Constructor Detail

SaloonCar

public SaloonCar(int carriageNo)
2a) Calls constructor of the superclass with carriage-number, etc.
Method Detail

getNameOfTypePlace

public java.lang.String getNameOfTypePlace(int typePlace)
2b) Defines the abstract method from the Carriage class. Converts the type of place specified by column-number to place name.
Overrides:
getNameOfTypePlace in class Carriage
Returns:
String of place name.

toString

public java.lang.String toString()
2c) Overrides the method from the Object class.
Overrides:
toString in class java.lang.Object
Returns:
A string with indicates it is a saloon car with a particular carriage number.