A C D E F G H I L M N P R S T U W

A

AISLE_LEFT - Static variable in class SaloonCar
Window left seat type
AISLE_LEFT_OPTION - Static variable in class TrainReservationSystem
Menu option Aisle Left button
AISLE_RIGHT - Static variable in class SaloonCar
Aisle right seat type
AISLE_RIGHT_OPTION - Static variable in class TrainReservationSystem
Menu option Aisle Right button

C

Carriage - class Carriage.
This abstract class defines a carriage.
Carriage(int, int, int) - Constructor for class Carriage
1a) Constructs a new Carriage class that initializes the carriageNumber, noOfRows, noOfColumns, carriagePlan, and noOfVacantPlaces.
carriageNumber - Variable in class Carriage
Carriage number
carriagePlan - Variable in class Carriage
Plan for carriage.
carriages - Variable in class Train
Array for carriages.
currentIndex - Variable in class Train
Index of last carriage inserted in the train
currentSaloonCar - Variable in class Train
Current Saloon car for making a reservation
currentSleepingCar - Variable in class Train
Current Sleeping car for making a reservation
currentTrain - Static variable in class TrainReservationSystem
Current train

D

displayMainMenu() - Static method in class TrainReservationSystem
Displays the Main Menu
displayReservationMenu() - Static method in class TrainReservationSystem
Displays Reservation menu
displaySaloonMenu() - Static method in class TrainReservationSystem
Displays Saloon Menu
displaySleepingMenu() - Static method in class TrainReservationSystem
Displays Sleeping Menu
drawCarriagePlan(int) - Method in class Carriage
1j) Draw the plan of the carriage.

E

EXIT_MAIN_MENU_OPTION - Static variable in class TrainReservationSystem
Menu option for Exit
EXIT_RESERVATION_MENU_OPTION - Static variable in class TrainReservationSystem
Menu option for Main Menu
EXIT_SALOON_CAR_MENU_OPTION - Static variable in class TrainReservationSystem
Menu option Back menu button
EXIT_SLEEPING_CAR_MENU_OPTION - Static variable in class TrainReservationSystem
Menu option for Back menu Button

F

findRowNoOfFirstVacantPlace(int) - Method in class Carriage
1g) Find row-number of the first vacant place of the specified type in the carriage.

G

getCarriageNo() - Method in class Carriage
1b) Returns carriage number of the carriage.
getInt() - Static method in class Stdin
Reads and returns an integer from the terminal.
getNameOfTypePlace(int) - Method in class Carriage
Abstract method that returns the name of the type of place
getNameOfTypePlace(int) - Method in class SaloonCar
2b) Defines the abstract method from the Carriage class.
getNameOfTypePlace(int) - Method in class SleepingCar
2b) Defines the abstract method from the Carriage class.
getText() - Static method in class Stdin
Reads and returns a line of text from the terminal.

H

hasVacantPlace(int) - Method in class Carriage
1d) Checks if the carriage has vacant places of the type specified in the parameter.

I

in - Static variable in class Stdin
User input stream
insertNewCarriage(Carriage) - Method in class Train
3c) Insert a new carriage of the type specified by the parameter thisCarriage.
isFull() - Method in class Carriage
1e) Check if the carriage is full.

L

LOWER_BERTH - Static variable in class SleepingCar
Lower Berth type
LOWER_BERTH_OPTION - Static variable in class TrainReservationSystem
Menu option for Lower Berth

M

main(String[]) - Static method in class TrainReservationSystem
Initializes user input and train, and starts the system.
mainMenu() - Static method in class TrainReservationSystem
Logic for the main menu.
MAX_NO_OF_CARRIAGES - Static variable in class TrainReservationSystem
Maximum number of carriages allowed in a train
MIDDLE_BERTH - Static variable in class SleepingCar
Middle Berth type
MIDDLE_BERTH_OPTION - Static variable in class TrainReservationSystem
Menu option for Middle Berth

N

NO_OF_BERTHS_PER_COMPARTMENT - Static variable in class SleepingCar
Number of Berths in a compartment
NO_OF_COMPARTMENTS_PER_SLEEPING_CAR - Static variable in class SleepingCar
Number of compartments in a Sleeping Car
NO_OF_SEATROWS_PER_SALOON_CAR - Static variable in class SaloonCar
Number of rows in a Saloon Car
NO_OF_SEATS_PER_SEATROW - Static variable in class SaloonCar
Number of seats per row in a Saloon Car
noOfColumns - Variable in class Carriage
Number of columns in a carriage
noOfRows - Variable in class Carriage
Number of rows in a carriage
noOfVacantPlaces - Variable in class Carriage
Array to keep track numbers of vacant places of each type of place.

P

placePositionToPlaceNo(int, int) - Method in class Carriage
1h) Convert (i,j)-pair in the plan to place number in the carriage.
placeReservation(Carriage, int) - Method in class Train
3d) Makes a reservation according to the criteria given in the text.
placeReservation(int, int) - Method in class Train
Makes the reservation in the appropriate carriage with the given type of place.

R

RESERVATION_MENU_OPTION - Static variable in class TrainReservationSystem
Menu option for Reservation menu
reservationMenu() - Static method in class TrainReservationSystem
4b) Logic for the reservation menu
reserveFirstVacantPlace(int) - Method in class Carriage
1i) Reserve the first vacant place of the specified type.

S

SALOON_CAR_OPTION - Static variable in class TrainReservationSystem
Menu option for Saloon car
SALOON_CAR_TYPE - Static variable in class SaloonCar
Saloon Car type
SaloonCar - class SaloonCar.
Class defines a saloon car.
SaloonCar(int) - Constructor for class SaloonCar
2a) Calls constructor of the superclass with carriage-number, etc.
saloonMenu() - Static method in class TrainReservationSystem
4a) Logic for the Saloon Menu
setOccupied(int, int) - Method in class Carriage
1c) Sets the given place in the carriage plan to occupied.
SLEEPING_CAR_OPTION - Static variable in class TrainReservationSystem
Menu option for Sleeping Car
SLEEPING_CAR_TYPE - Static variable in class SleepingCar
Sleeping Car type
SleepingCar - class SleepingCar.
Class defines a sleeping car.
SleepingCar(int) - Constructor for class SleepingCar
2a) Calls constructor of the superclass with carriage-number, etc.
sleepingMenu() - Static method in class TrainReservationSystem
Logic for the Sleeping Menu
Stdin - class Stdin.
 
Stdin() - Constructor for class Stdin
 

T

toString() - Method in class SaloonCar
2c) Overrides the method from the Object class.
toString() - Method in class SleepingCar
2c) Overrides the method from the Object class.
Train - class Train.
Defines a class for making place reservation on a train
TRAIN_SUMMARY_OPTION - Static variable in class TrainReservationSystem
Menu option for Train Summary
Train(int) - Constructor for class Train
3a) Constructs an array of carriages with maxNoOfCarriages and initializes all instance variables.
TrainReservationSystem - class TrainReservationSystem.
This class implements the user interface for making reservations on a train.
TrainReservationSystem() - Constructor for class TrainReservationSystem
 
trainSummary() - Method in class Train
3b) Prints out a summary for the train, consisting of: - number of saloon cars in the train.
typePlaceWithLeastOccupancy() - Method in class Carriage
1f) Find the type of place in the carriage which has least occupancy and returns -1 if the carriage is full.

U

UPPER_BERTH - Static variable in class SleepingCar
Upper Berth type
UPPER_BERTH_OPTION - Static variable in class TrainReservationSystem
Menu option for Upper Berth

W

WINDOW_LEFT - Static variable in class SaloonCar
Window left seat type
WINDOW_LEFT_OPTION - Static variable in class TrainReservationSystem
Menu option Window left button
WINDOW_RIGHT - Static variable in class SaloonCar
Window right seat type
WINDOW_RIGHT_OPTION - Static variable in class TrainReservationSystem
Menu option Window Right button

A C D E F G H I L M N P R S T U W