Kereta Yarsi Indonesia
Loading...
Searching...
No Matches
model.Train Class Reference

Public Member Functions

 Train ()
 
 Train (int trainID, String name, String startingStation, String endingStation, Timestamp departingTime, Timestamp arrivingTime, int price)
 
int getTrainID ()
 
void setTrainID (int trainID)
 
String getName ()
 
void setName (String name)
 
String getStartingStation ()
 
void setStartingStation (String startingStation)
 
String getEndingStation ()
 
void setEndingStation (String endingStation)
 
Timestamp getDepartingTime ()
 
void setDepartingTime (Timestamp departingTime)
 
Timestamp getArrivingTime ()
 
void setArrivingTime (Timestamp arrivingTime)
 
int getPrice ()
 
void setPrice (int price)
 

Detailed Description

The Train class represents a train with its details such as train ID, name, starting station, ending station, departing and arriving times, and price. It provides getters and setters for accessing and modifying these details.

Instances of this class can be used to store and manipulate information about trains in a railway reservation system.

Version
1.0
Since
2024-06-23
See also
TrainDAO
controller.TrainController
Author
Muhammad Rizal Anditama Nugraha

Constructor & Destructor Documentation

◆ Train() [1/2]

model.Train.Train ( )
inline

Constructs a new Train object with default values.

◆ Train() [2/2]

model.Train.Train ( int  trainID,
String  name,
String  startingStation,
String  endingStation,
Timestamp  departingTime,
Timestamp  arrivingTime,
int  price 
)
inline

Constructs a new Train object with the specified values.

Parameters
trainIDthe ID of the train
namethe name of the train
startingStationthe starting station of the train
endingStationthe ending station of the train
departingTimethe departing time of the train
arrivingTimethe arriving time of the train
pricethe price of the train ticket

Member Function Documentation

◆ getArrivingTime()

Timestamp model.Train.getArrivingTime ( )
inline
Returns
the arriving time of the train

◆ getDepartingTime()

Timestamp model.Train.getDepartingTime ( )
inline
Returns
the departing time of the train

◆ getEndingStation()

String model.Train.getEndingStation ( )
inline
Returns
the ending station of the train

◆ getName()

String model.Train.getName ( )
inline
Returns
the name of the train

◆ getPrice()

int model.Train.getPrice ( )
inline
Returns
the price of the train ticket

◆ getStartingStation()

String model.Train.getStartingStation ( )
inline
Returns
the starting station of the train

◆ getTrainID()

int model.Train.getTrainID ( )
inline
Returns
the train ID

◆ setArrivingTime()

void model.Train.setArrivingTime ( Timestamp  arrivingTime)
inline
Parameters
arrivingTimethe arriving time to set

◆ setDepartingTime()

void model.Train.setDepartingTime ( Timestamp  departingTime)
inline
Parameters
departingTimethe departing time to set

◆ setEndingStation()

void model.Train.setEndingStation ( String  endingStation)
inline
Parameters
endingStationthe ending station to set

◆ setName()

void model.Train.setName ( String  name)
inline
Parameters
namethe name of the train to set

◆ setPrice()

void model.Train.setPrice ( int  price)
inline
Parameters
pricethe price to set

◆ setStartingStation()

void model.Train.setStartingStation ( String  startingStation)
inline
Parameters
startingStationthe starting station to set

◆ setTrainID()

void model.Train.setTrainID ( int  trainID)
inline
Parameters
trainIDthe train ID to set

The documentation for this class was generated from the following file: