Commit d3e53022 authored by 9731050's avatar 9731050

second

parent 0a28a80b
package com.TicketManagement; package com.TicketManagement;
import java.util.ArrayList; import java.util.ArrayList;
/**
* this class is our passenger's class
*
* @author Mohammad Kazemi
*/
public class Passenger { public class Passenger {
private String name,lastname; private String name,lastname;
private int ID; private int ID;
private ArrayList<Ticket> tickets; private ArrayList<Ticket> tickets;
public Passenger(String name,String lastname,int ID){ public Passenger(String name,String lastname,int ID){
this.name=name; this.name=name;
this.ID=ID; this.ID=ID;
this.lastname=lastname; this.lastname=lastname;
tickets= new ArrayList<Ticket>(); tickets= new ArrayList<Ticket>();
} }
/**
* this method adds to to list of passenger ticket tickets
* @param ticket
*/
public void addTicket(Ticket ticket){ public void addTicket(Ticket ticket){
tickets.add(ticket); tickets.add(ticket);
} }
/**
*
* @return list of passenger ticket
*/
public ArrayList<Ticket> getTickets() { public ArrayList<Ticket> getTickets() {
return tickets; return tickets;
} }
/**
*
* @return passenger id
*/
public int getID() { public int getID() {
return ID; return ID;
} }
/**
*
* @return passenger name
*/
public String getName() { public String getName() {
return name; return name;
} }
/**
*
* @return passenger lastname
*/
public String getLastname() { public String getLastname() {
return lastname; return lastname;
} }
......
package com.TicketManagement; package com.TicketManagement;
import java.util.ArrayList; import java.util.ArrayList;
/**
* this class indicates a seat and it's features for us
*
* @author Mohammad Kazemi
*/
public class Seat { public class Seat {
private int ID; private int ID;
private String type; private String type;
...@@ -11,18 +15,34 @@ public class Seat { ...@@ -11,18 +15,34 @@ public class Seat {
this.ID=ID; this.ID=ID;
} }
/**
*
* @return id of seat
*/
public int getID() { public int getID() {
return ID; return ID;
} }
/**
*
* @return type of seat
*/
public String getType() { public String getType() {
return type; return type;
} }
/**
*this method determines that this passenger will sit on this seat
* @param passenger
*/
public void setUser(Passenger passenger){ public void setUser(Passenger passenger){
user=passenger; user=passenger;
} }
/**
*
* @return a passenger sitting on the seat
*/
public Passenger getUser(){ public Passenger getUser(){
return user; return user;
} }
......
...@@ -17,7 +17,7 @@ public class Ticket { ...@@ -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 * @param food
*/ */
public void food(boolean food){this.food=food;} public void food(boolean food){this.food=food;}
...@@ -37,10 +37,18 @@ public class Ticket { ...@@ -37,10 +37,18 @@ public class Ticket {
return food; return food;
} }
/**
*
* @return flightNumber
*/
public int getFlightnumber() { public int getFlightnumber() {
return flightNumber; return flightNumber;
} }
/**
*
* @return seatNumber
*/
public int getSeatnumber() { public int getSeatnumber() {
return seatNumber; 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