Commit d3e53022 authored by 9731050's avatar 9731050

second

parent 0a28a80b
package com.TicketManagement;
import java.util.ArrayList;
/**
* this class is our passenger's class
*
* @author Mohammad Kazemi
*/
public class Passenger {
private String name,lastname;
private int ID;
private ArrayList<Ticket> tickets;
public Passenger(String name,String lastname,int ID){
this.name=name;
this.ID=ID;
this.lastname=lastname;
tickets= new ArrayList<Ticket>();
}
/**
* this method adds to to list of passenger ticket tickets
* @param ticket
*/
public void addTicket(Ticket ticket){
tickets.add(ticket);
}
/**
*
* @return list of passenger ticket
*/
public ArrayList<Ticket> getTickets() {
return tickets;
}
/**
*
* @return passenger id
*/
public int getID() {
return ID;
}
/**
*
* @return passenger name
*/
public String getName() {
return name;
}
/**
*
* @return passenger lastname
*/
public String getLastname() {
return lastname;
}
......
package com.TicketManagement;
import java.util.ArrayList;
/**
* this class indicates a seat and it's features for us
*
* @author Mohammad Kazemi
*/
public class Seat {
private int ID;
private String type;
......@@ -11,18 +15,34 @@ public class Seat {
this.ID=ID;
}
/**
*
* @return id of seat
*/
public int getID() {
return ID;
}
/**
*
* @return type of seat
*/
public String getType() {
return type;
}
/**
*this method determines that this passenger will sit on this seat
* @param passenger
*/
public void setUser(Passenger passenger){
user=passenger;
}
/**
*
* @return a passenger sitting on the seat
*/
public Passenger getUser(){
return user;
}
......
......@@ -17,7 +17,7 @@ public class Ticket {
}
/**
* this method determines whether or not we receive a ticket for
* this method determines whether or not we want a ticket for food
* @param food
*/
public void food(boolean food){this.food=food;}
......@@ -37,10 +37,18 @@ public class Ticket {
return food;
}
/**
*
* @return flightNumber
*/
public int getFlightnumber() {
return flightNumber;
}
/**
*
* @return seatNumber
*/
public int getSeatnumber() {
return seatNumber;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment